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-16234.Improve DataNodeMetrics to initialize IBR more reasonable. #3469

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ private synchronized StorageReceivedDeletedBlocks[] generateIBRs() {
}
}

/* set blocks to zero */
this.dnMetrics.resetBlocksInPendingIBR();

readyToSend = false;
return reports.toArray(new StorageReceivedDeletedBlocks[reports.size()]);
}
Expand All @@ -198,6 +195,9 @@ void sendIBRs(DatanodeProtocol namenode, DatanodeRegistration registration,
// Generate a list of the pending reports for each storage under the lock
final StorageReceivedDeletedBlocks[] reports = generateIBRs();
if (reports.length == 0) {
/* set blocks to zero */
this.dnMetrics.resetBlocksInPendingIBR();

// Nothing new to report.
return;
}
Expand All @@ -212,6 +212,8 @@ void sendIBRs(DatanodeProtocol namenode, DatanodeRegistration registration,
namenode.blockReceivedAndDeleted(registration, bpid, reports);
success = true;
} finally {
/* set blocks to zero */
this.dnMetrics.resetBlocksInPendingIBR();
Comment on lines +215 to +216
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't check in detail but shouldn't this be in success block? In case it isn't success, it puts the blocks back into the queue


if (success) {
dnMetrics.addIncrementalBlockReport(monotonicNow() - startTime,
Expand Down