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 "xinglin (via GitHub)" <gi...@apache.org> on 2023/08/01 06:01:35 UTC
[GitHub] [hadoop] xinglin commented on a diff in pull request #5855: HDFS-17093. In the case of all datanodes sending FBR when the namenode restarts (large clusters), there is an issue with incomplete block reporting
xinglin commented on code in PR #5855:
URL: https://github.com/apache/hadoop/pull/5855#discussion_r1280143136
##########
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:
I like @zhangshuyan0's proposal better.
The following section of code can also be separated to be a function on its own.
```
// Remove the lease when we have received block reports for all storages for a particular DN.
void removeLease() {
for (DatanodeStorageInfo sInfo : node.getStorageInfos()) {
if (sInfo.getBlockReportCount() == 0) {
needRemoveLease = false;
}
}
if (needRemoveLease) {
blockReportLeaseManager.removeLease(node);
}
}
```
--
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-unsubscribe@hadoop.apache.org
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