-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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-17368. HA: Standby should exit safemode when resources are available. #6518
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@Hexiaoqiao @tasanuma @aajisaka Hi~ sir. Could you please help me review this PR when you are free? Thanks. |
💔 -1 overall
This message was automatically generated. |
The failed unit test seems unrelated to the change. |
@@ -1582,6 +1582,10 @@ void startStandbyServices(final Configuration conf, boolean isObserver) | |||
standbyCheckpointer = new StandbyCheckpointer(conf, this); | |||
standbyCheckpointer.start(); | |||
} | |||
if (isNoManualAndResourceLowSafeMode()) { | |||
LOG.info("Standby should not enter safe mode when resources are low, exiting safe mode."); | |||
leaveSafeMode(false); |
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.
It is reasonable at first glance, not think carefully, any cases to trigger Standby leave safemode untimely? Thanks.
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 reused the logic from HDFS-17231, and I believe there is no issue. HDFS-17231 enables the ANN to automatically exit ResourceLowSafeMode.
At the same time, I noticed that the 'leaveSafeMode(false)' method also exits 'StartupSafeMode'. I'm not sure if this is an issue; I mentioned this phenomenon in HDFS-17402.
If necessary, I can fix it.
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.
The mention in "HDFS-2915" is that SNN should not enter resource low safe mode. NNRM thread removed from SNN.
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.
Consider the following scenario:
Initially, nn-1 is active and nn-2 is standby. The insufficient resources of both nn-1 and nn-2 in dfs.namenode.name.dir, the NameNodeResourceMonitor detects the resource issue and puts nn01 into safemode.
At this point, nn-1 is in safemode (ON) and active, while nn-2 is in safemode (OFF) and standby.
After a period of time, the resources in nn-2's dfs.namenode.name.dir recover, triggering failover.
Now, nn-1 is in safe mode (ON) and standby, while nn-2 is in safe mode (OFF) and active.
Afterward, the resources in nn-1's dfs.namenode.name.dir recover.
However, since nn-1 is standby but in safemode (ON), it unable to exit safe mode automatically.
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.
Great. Got it. Please check if the failed unit test is related with this changes. Others look good to me.
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.
Thanks for your review. I passed the failed unit test locally.
cc @zhangshuyan0 any more suggestions? |
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. Will check in if no more comments here for two workdays.
Committed to trunk. Thanks @zhuzilong2013 for your contributions! |
Thanks @Hexiaoqiao for your review and merge~ |
Description of PR
Refer to HDFS-17368.
The NameNodeResourceMonitor automatically enters safemode when it detects that the resources are not suffcient. NNRM is only in ANN. If both ANN and SNN enter SM due to low resources, and later SNN's disk space is restored, SNN willl become ANN and ANN will become SNN. However, at this point, SNN will not exit the SM, even if the disk is recovered.
Consider the following scenario:
If SNN is detected to be in SM(because low resource), it will exit.
How was this patch tested?
Test in a production environment
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?