Skip to content

Commit cafe3c6

Browse files
committed
HDFS-17218. Modify patch based on comments
1 parent 7fa80cc commit cafe3c6

File tree

1 file changed

+7
-6
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement

1 file changed

+7
-6
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3112,18 +3112,20 @@ void processTimedOutExcessBlocks() {
31123112
if (processed >= excessRedundancyTimeoutCheckLimit) {
31133113
break;
31143114
}
3115-
BlockInfo blockInfo = excessBlockInfo.getBlockInfo();
3116-
BlockInfo bi = blocksMap.getStoredBlock(blockInfo);
3117-
if (bi == null || bi.isDeleted()) {
3118-
continue;
3119-
}
31203115

3116+
processed++;
31213117
// If the datanode doesn't have any excess block that has exceeded the timeout,
31223118
// can exit this loop.
31233119
if (now <= excessBlockInfo.getTimeStamp() + excessRedundancyTimeout) {
31243120
break;
31253121
}
31263122

3123+
BlockInfo blockInfo = excessBlockInfo.getBlockInfo();
3124+
BlockInfo bi = blocksMap.getStoredBlock(blockInfo);
3125+
if (bi == null || bi.isDeleted()) {
3126+
continue;
3127+
}
3128+
31273129
Iterator<DatanodeStorageInfo> iterator = blockInfo.getStorageInfos();
31283130
while (iterator.hasNext()) {
31293131
DatanodeStorageInfo datanodeStorageInfo = iterator.next();
@@ -3138,7 +3140,6 @@ void processTimedOutExcessBlocks() {
31383140
block, datanodeDescriptor);
31393141
}
31403142
excessBlockInfo.setTimeStamp();
3141-
processed++;
31423143
break;
31433144
}
31443145
}

0 commit comments

Comments
 (0)