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-16426. Fix nextBlockReportTime when trigger full block report force #3887
Conversation
// If we have sent the first set of block reports, then wait a random | ||
// time before we start the periodic block reports. | ||
if (resetBlockReportTime) { | ||
nextBlockReportTime.getAndSet(monotonicNow() + | ||
ThreadLocalRandom.current().nextInt((int) (blockReportIntervalMs))); | ||
resetBlockReportTime = false; | ||
} else if (forceFullBr) { | ||
nextBlockReportTime.getAndSet(monotonicNow() + blockReportIntervalMs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If many datanodes of a large cluster is triggered in batches, the FBR time of these datanodes will be concentrated in the future, which may cause great pressure on NN. Maybe we also need to add a random value here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that in most of cases, we want to know the exactly nextBlockReportTime if we trigger block report by force.
As for trigger full block report in batches, I think it is a dangerous behavior because it may cause some datanode heartbeat timeout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that in most of cases, we want to know the exactly nextBlockReportTime if we trigger block report by force. As for trigger full block report in batches, I think it is a dangerous behavior because it may cause some datanode heartbeat timeout.
I mean, if we trigger the FBR on some nodes in a short period of time, it will affect the original randomness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liubingxing @tomscut
Thanks for the discussion. IMHO, I prefer to use a random time to keep the randomness.
I think HDFS-15167 causes this problem. Before HDFS-15167, resetBlockReportTime
is true when triggering full block report by force, and it used a random time.
🎊 +1 overall
This message was automatically generated. |
@tasanuma @Hexiaoqiao Please take a look. |
1a64e33
to
6965a47
Compare
@tasanuma Thanks for your advice, I update the PR to set resetBlockReportTime=true when triggering full block report by force. Please take a look. |
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks for your contribution, @liubingxing. Thanks for your review, @tomscut. |
…rce (apache#3887) (cherry picked from commit fcb1076)
jira: HDFS-16426
When we trigger full block report force by command line, the next block report time will be set like this:
nextBlockReportTime.getAndAdd(blockReportIntervalMs);
nextBlockReportTime will larger than blockReportIntervalMs.
If we trigger full block report twice, the nextBlockReportTime will larger than 2 * blockReportIntervalMs. This is obviously not what we want.
We fix the nextBlockReportTime = now + blockReportIntervalMs after full block report trigger by command line.