You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/03/19 05:38:59 UTC

[GitHub] [hadoop] jojochuang commented on a change in pull request #2782: HDFS-15901.Solve the problem of DN repeated block reports occupying too many RPCs during Safemode.

jojochuang commented on a change in pull request #2782:
URL: https://github.com/apache/hadoop/pull/2782#discussion_r597418628



##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
##########
@@ -2603,6 +2603,24 @@ public long requestBlockReportLeaseId(DatanodeRegistration nodeReg) {
       LOG.warn("Failed to find datanode {}", nodeReg);
       return 0;
     }
+
+    // During safemode, DataNodes are only allowed to report all data once.
+    if (namesystem.isInStartupSafeMode()) {
+      boolean allReported = true;
+      for (DatanodeStorageInfo storageInfo : node.getStorageInfos()) {
+        if (storageInfo.getBlockReportCount() < 1) {
+          allReported = false;
+          break;
+        }
+      }
+
+      if (allReported) {
+        LOG.info("The DataNode has reported all blocks and does not need " +

Review comment:
       nit: print datanode id/ip/address would be helpful here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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