Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDFS-17453. IncrementalBlockReport can have race condition with Edit Log Tailer #6708

Merged
merged 12 commits into from
Apr 10, 2024
Prev Previous commit
Fix unit tests
  • Loading branch information
Danny Becker committed Apr 9, 2024
commit 7e36db7affc66da101cfda141c9f35afc82aa606
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ void removeAllMessagesForDatanode(DatanodeDescriptor dn) {

void enqueueReportedBlock(DatanodeStorageInfo storageInfo, Block block,
ReplicaState reportedState) {
if (storageInfo == null || block == null || reportedState == null) {
if (storageInfo == null || block == null) {
return;
}
block = new Block(block);
long genStamp = block.getGenerationStamp();
Queue<ReportedBlockInfo> queue = null;
if (BlockIdManager.isStripedBlockID(block.getBlockId())) {
Expand All @@ -117,7 +118,7 @@ void enqueueReportedBlock(DatanodeStorageInfo storageInfo, Block block,
rbi.block.getGenerationStamp() <= genStamp)) {
count -= (size - queue.size());
}
queue.add(new ReportedBlockInfo(storageInfo, new Block(block), reportedState));
queue.add(new ReportedBlockInfo(storageInfo, block, reportedState));
count++;
}

Expand Down
Loading