-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-16402. Improve HeartbeatManager logic to avoid incorrect stats. #3839
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
Conversation
|
💔 -1 overall
This message was automatically generated. |
|
It's good catch here. Would you mind to add new test to cover this case? |
Thanks @Hexiaoqiao for your review and comments. The main reason is that the Here is the scenario we encountered: |
|
Thanks @tomscut for your information. It makes sense to me. I concerned why HDFS-14042 not fix completely, any other corner case? |
Thanks @Hexiaoqiao for your comments. NPE has been fixed by HDFS-14042. IMO, it is a safer way to keep these two operations ( |
|
Ok, I'll try to add a unit test later. Thanks for your review. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
Hi @Hexiaoqiao , I added an unit test for this change. Please take a look. Thanks. |
|
The failed unit test |
Hexiaoqiao
left a comment
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. +1. The failed unit test seems not to related to this changes. re-trigger jenkins and let's wait what he says.
|
🎊 +1 overall
This message was automatically generated. |
Thanks @Hexiaoqiao for your review. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
…pache#3839). Contributed by tomscut. Reviewed-by: He Xiaoqiao <[email protected]>

JIRA: HDFS-16402.
After reconfig


dfs.datanode.data.dir, we found that the stats of the Namenode Web became negative and there were many NPE in namenode logs. This problem has been solved by HDFS-14042.However, if
HeartbeatManager#updateHeartbeatandHeartbeatManager#updateLifelinethrow other exceptions, stats errors can also occur. We should ensure thatstats.subtract()andstats.add()are transactional.