Browse Source

HDFS-17310. DiskBalancer: Enhance the log message for submitPlan (#6391) Contributed by Haiyang Hu.

Reviewed-by: Ashutosh Gupta <ashugpt@amazon.com>
Reviewed-by: Takanobu Asanuma <tasanuma@apache.org>
Signed-off-by: Shilun Fan <slfan1989@apache.org>
huhaiyang 1 year ago
parent
commit
7a7db7f0dc

+ 5 - 4
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java

@@ -184,7 +184,8 @@ public class DiskBalancer {
     try {
       checkDiskBalancerEnabled();
       if ((this.future != null) && (!this.future.isDone())) {
-        LOG.error("Disk Balancer - Executing another plan, submitPlan failed.");
+        LOG.error("Disk Balancer - Executing another plan (Plan File: {}, Plan ID: {}), " +
+            "submitPlan failed.", planFile, planID);
         throw new DiskBalancerException("Executing another plan",
             DiskBalancerException.Result.PLAN_ALREADY_IN_PROGRESS);
       }
@@ -523,7 +524,7 @@ public class DiskBalancer {
 
       String sourceVolBasePath = storageIDToVolBasePathMap.get(sourceVolUuid);
       if (sourceVolBasePath == null) {
-        final String errMsg = "Disk Balancer - Unable to find volume: "
+        final String errMsg = "Disk Balancer - Unable to find source volume: "
             + step.getSourceVolume().getPath() + ". SubmitPlan failed.";
         LOG.error(errMsg);
         throw new DiskBalancerException(errMsg,
@@ -532,7 +533,7 @@ public class DiskBalancer {
 
       String destVolBasePath = storageIDToVolBasePathMap.get(destVolUuid);
       if (destVolBasePath == null) {
-        final String errMsg = "Disk Balancer - Unable to find volume: "
+        final String errMsg = "Disk Balancer - Unable to find dest volume: "
             + step.getDestinationVolume().getPath() + ". SubmitPlan failed.";
         LOG.error(errMsg);
         throw new DiskBalancerException(errMsg,
@@ -1058,7 +1059,7 @@ public class DiskBalancer {
       FsVolumeSpi source = getFsVolume(this.dataset, sourceVolUuid);
       if (source == null) {
         final String errMsg = "Disk Balancer - Unable to find source volume: "
-            + pair.getDestVolBasePath();
+            + pair.getSourceVolBasePath();
         LOG.error(errMsg);
         item.setErrMsg(errMsg);
         return;