ZanderXu commented on code in PR #6759:
URL: https://github.com/apache/hadoop/pull/6759#discussion_r1575829376


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/IncrementalBlockReportManager.java:
##########
@@ -169,11 +169,17 @@ private synchronized StorageReceivedDeletedBlocks[] 
generateIBRs() {
         : pendingIBRs.entrySet()) {
       final PerStorageIBR perStorage = entry.getValue();
 
-        // Send newly-received and deleted blockids to namenode
+      // Send newly-received and deleted blockids to namenode
       final ReceivedDeletedBlockInfo[] rdbi = perStorage.removeAll();
-      if (rdbi != null) {
-        reports.add(new StorageReceivedDeletedBlocks(entry.getKey(), rdbi));
+      if (rdbi == null) {

Review Comment:
   ```
   if (rdbi != null) {
     // Null storage, should not happen
     if (entry.getKey() == null) {
       dnMetrics.incrNullStorageBlockReports();
       continue;
     }
     reports.add(new StorageReceivedDeletedBlocks(entry.getKey(), rdbi));
   }
   ```



##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java:
##########
@@ -2745,14 +2745,18 @@ public void checkAndUpdate(String bpid, ScanInfo 
scanInfo)
       curDirScannerNotifyCount = 0;
       lastDirScannerNotifyTime = startTimeMs;
     }
-    try (AutoCloseableLock lock = lockManager.writeLock(LockLevel.VOLUME, bpid,
-        vol.getStorageID())) {
+    String storageUuid = vol.getStorageID();
+    try (AutoCloseableLock lock = lockManager.writeLock(LockLevel.VOLUME, 
bpid, storageUuid)) {
       memBlockInfo = volumeMap.get(bpid, blockId);
       if (memBlockInfo != null &&
           memBlockInfo.getState() != ReplicaState.FINALIZED) {
         // Block is not finalized - ignore the difference
         return;
       }
+      if (!storageMap.containsKey(storageUuid)) {

Review Comment:
   How about moving this logic to line 2750?



##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/IncrementalBlockReportManager.java:
##########
@@ -304,4 +310,4 @@ void clearIBRs() {
   int getPendingIBRSize() {
     return pendingIBRs.size();
   }
-}
\ No newline at end of file
+}

Review Comment:
   can rollback this change



-- 
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: common-issues-unsubscr...@hadoop.apache.org

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


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

Reply via email to