hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rake...@apache.org
Subject [34/50] [abbrv] hadoop git commit: HDFS-11966. [SPS] Correct the log in BlockStorageMovementAttemptedItems#blockStorageMovementResultCheck. Contributed by Surendra Singh Lilhore.
Date Wed, 08 Nov 2017 13:19:00 GMT
HDFS-11966. [SPS] Correct the log in BlockStorageMovementAttemptedItems#blockStorageMovementResultCheck.
Contributed by Surendra Singh Lilhore.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/ca28e917
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/ca28e917
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/ca28e917

Branch: refs/heads/HDFS-10285
Commit: ca28e917889666c1ffec3dca36c07c4652ef3c7c
Parents: e8f2724
Author: Rakesh Radhakrishnan <rakeshr@apache.org>
Authored: Sun Jun 18 11:00:28 2017 +0530
Committer: Rakesh Radhakrishnan <rakeshr@apache.org>
Committed: Wed Nov 8 14:09:10 2017 +0530

----------------------------------------------------------------------
 .../BlockStorageMovementAttemptedItems.java     | 39 ++++++++++----------
 1 file changed, 20 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/ca28e917/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/BlockStorageMovementAttemptedItems.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/BlockStorageMovementAttemptedItems.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/BlockStorageMovementAttemptedItems.java
index bf7859c..6048986 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/BlockStorageMovementAttemptedItems.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/BlockStorageMovementAttemptedItems.java
@@ -296,19 +296,17 @@ public class BlockStorageMovementAttemptedItems {
             .next();
         synchronized (storageMovementAttemptedItems) {
           Status status = storageMovementAttemptedResult.getStatus();
+          long trackId = storageMovementAttemptedResult.getTrackId();
           ItemInfo itemInfo;
           switch (status) {
           case FAILURE:
-            blockStorageMovementNeeded
-                .add(storageMovementAttemptedResult.getTrackId());
+            blockStorageMovementNeeded.add(trackId);
             LOG.warn("Blocks storage movement results for the tracking id: {}"
                 + " is reported from co-ordinating datanode, but result"
-                + " status is FAILURE. So, added for retry",
-                storageMovementAttemptedResult.getTrackId());
+                + " status is FAILURE. So, added for retry", trackId);
             break;
           case SUCCESS:
-            itemInfo = storageMovementAttemptedItems
-                .get(storageMovementAttemptedResult.getTrackId());
+            itemInfo = storageMovementAttemptedItems.get(trackId);
 
             // ItemInfo could be null. One case is, before the blocks movements
             // result arrives the attempted trackID became timed out and then
@@ -318,20 +316,23 @@ public class BlockStorageMovementAttemptedItems {
             // following condition. If all the block locations under the trackID
             // are attempted and failed to find matching target nodes to satisfy
             // storage policy in previous SPS iteration.
-            if (itemInfo != null
-                && !itemInfo.isAllBlockLocsAttemptedToSatisfy()) {
-              blockStorageMovementNeeded
-                  .add(storageMovementAttemptedResult.getTrackId());
-              LOG.warn("Blocks storage movement is SUCCESS for the track id: {}"
-                  + " reported from co-ordinating datanode. But adding trackID"
-                  + " back to retry queue as some of the blocks couldn't find"
-                  + " matching target nodes in previous SPS iteration.",
-                  storageMovementAttemptedResult.getTrackId());
+            String msg = "Blocks storage movement is SUCCESS for the track id: "
+                + trackId + " reported from co-ordinating datanode.";
+            if (itemInfo != null) {
+              if (!itemInfo.isAllBlockLocsAttemptedToSatisfy()) {
+                blockStorageMovementNeeded.add(trackId);
+                LOG.warn("{} But adding trackID back to retry queue as some of"
+                    + " the blocks couldn't find matching target nodes in"
+                    + " previous SPS iteration.", msg);
+              } else {
+                LOG.info(msg);
+                // Remove xattr for the track id.
+                this.sps.postBlkStorageMovementCleanup(
+                    storageMovementAttemptedResult.getTrackId());
+              }
             } else {
-              LOG.info("Blocks storage movement is SUCCESS for the track id: {}"
-                  + " reported from co-ordinating datanode. But the trackID "
-                  + "doesn't exists in storageMovementAttemptedItems list",
-                  storageMovementAttemptedResult.getTrackId());
+              LOG.info("{} But the trackID doesn't exists in "
+                  + "storageMovementAttemptedItems list", msg);
               // Remove xattr for the track id.
               this.sps.postBlkStorageMovementCleanup(
                   storageMovementAttemptedResult.getTrackId());


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message