Tre2878 commented on code in PR #5855:
URL: https://github.com/apache/hadoop/pull/5855#discussion_r1280190216


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java:
##########
@@ -2904,7 +2908,8 @@ public boolean processReport(final DatanodeID nodeID,
       }
       if (namesystem.isInStartupSafeMode()
           && !StorageType.PROVIDED.equals(storageInfo.getStorageType())
-          && storageInfo.getBlockReportCount() > 0) {
+          && storageInfo.getBlockReportCount() > 0
+          && totalReportNum == currentReportNum) {

Review Comment:
   Two of the cases will come into this logic
   1. The namenode is restarting while receiving FBRS from all datanodes and is 
in safe mode
   2. When the namenode is in secure mode for some reason while it has been 
running for a long time
   In the first case, if the datanode has a failed disk, the datanode will send 
the FBR for the normal disk and the namenode will handle it normally
   In the second case, blockReportCount == 0 will always be false if no new 
disks are added to the datanode
   So I recommend keeping the code as it is and not using blockReportCount == 0



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to