This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 0157da9aff HDDS-9012. Log more information about failed EC block 
allocation (#5062)
0157da9aff is described below

commit 0157da9aff67d97fe5350560f347a6fbad42adaf
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Fri Jul 14 08:53:46 2023 +0200

    HDDS-9012. Log more information about failed EC block allocation (#5062)
---
 .../scm/container/common/helpers/ExcludeList.java   |  2 +-
 .../scm/pipeline/WritableECContainerProvider.java   | 21 ++++++++++++++-------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git 
a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/container/common/helpers/ExcludeList.java
 
b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/container/common/helpers/ExcludeList.java
index 0ffa8d68e8..567e28e186 100644
--- 
a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/container/common/helpers/ExcludeList.java
+++ 
b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/container/common/helpers/ExcludeList.java
@@ -145,7 +145,7 @@ public class ExcludeList {
   @Override
   public String toString() {
     return "ExcludeList {" +
-        "datanodes = " + getDatanodes() +
+        "datanodes = " + datanodes.keySet() +
         ", containerIds = " + containerIds +
         ", pipelineIds = " + pipelineIds +
         '}';
diff --git 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java
 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java
index 523ba19cde..6e2950a286 100644
--- 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java
+++ 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java
@@ -102,14 +102,21 @@ public class WritableECContainerProvider
         try {
           return allocateContainer(repConfig, size, owner, excludeList);
         } catch (IOException e) {
-          LOG.warn("Unable to allocate a container for {} with {} existing "
-              + "containers", repConfig, openPipelineCount, e);
+          LOG.warn("Unable to allocate a container with {} existing ones; "
+              + "requested size={}, replication={}, owner={}, {}",
+              openPipelineCount, size, repConfig, owner, excludeList, e);
         }
+      } else if (LOG.isDebugEnabled()) {
+        LOG.debug("Pipeline count {} reached limit {}, checking existing ones; 
"
+            + "requested size={}, replication={}, owner={}, {}",
+            openPipelineCount, maximumPipelines, size, repConfig, owner,
+            excludeList);
       }
     }
     List<Pipeline> existingPipelines = pipelineManager.getPipelines(
         repConfig, Pipeline.PipelineState.OPEN,
         excludeList.getDatanodes(), excludeList.getPipelineIds());
+    final int pipelineCount = existingPipelines.size();
 
     PipelineRequestInformation pri =
         PipelineRequestInformation.Builder.getBuilder()
@@ -156,13 +163,13 @@ public class WritableECContainerProvider
         if (openPipelineCount < maximumPipelines) {
           return allocateContainer(repConfig, size, owner, excludeList);
         }
-        throw new IOException("Unable to allocate a pipeline for "
-            + repConfig + " after trying all existing pipelines as the max "
-            + "limit has been reached and no pipelines where closed");
+        throw new IOException("Pipeline limit (" + maximumPipelines
+            + ") reached (" + openPipelineCount + "), none closed");
       }
     } catch (IOException e) {
-      LOG.error("Unable to allocate a container for {} after trying all "
-          + "existing containers", repConfig, e);
+      LOG.warn("Unable to allocate a container after trying {} existing ones; "
+          + "requested size={}, replication={}, owner={}, {}",
+          pipelineCount, size, repConfig, owner, excludeList, e);
       throw e;
     }
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to