-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-17438. RBF: The newest STANDBY and UNAVAILABLE nn should be the lowest priority. #6655
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. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
| try { | ||
| DatanodeInfo[] dns = this.dnCache.get(type); | ||
| if (dns == null) { | ||
| if (dns.length == 0) { |
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 it is safer to check for both null and length.
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.
done.
...bf/src/test/java/org/apache/hadoop/hdfs/server/federation/resolver/TestNamenodeResolver.java
Show resolved
Hide resolved
|
💔 -1 overall
This message was automatically generated. |
|
@goiri hi, hadoop-hdfs-project/hadoop-hdfs-rbf in trunk has 1 extant spotbugs warnings, do you have any suggestions? |
| // Verify the selected entry is the oldest standby entry | ||
| assertTrue(namenodeResolver.registerNamenode(createNamenodeReport( | ||
| NAMESERVICES[0], NAMENODES[0], HAServiceState.STANDBY))); | ||
| Thread.sleep(1500); |
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.
We shouldn't be adding waits like this, can we add a GenericTestUtils#waitFor or similar?
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.
This suggestion sounds good, I added GenericTestUtils#atLeastWaitFor method, please help to take a look.
|
💔 -1 overall
This message was automatically generated. |
| try { | ||
| return namenodeResolver.registerNamenode( | ||
| createNamenodeReport(nsId, nnId, haServiceState)); | ||
| }catch (IOException e) { |
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.
small comment, There should be a space
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.
Thank you for your review, done.
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@goiri hi, If you have time, please take a look again, thanks. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
Show resolved
Hide resolved
|
💔 -1 overall
This message was automatically generated. |
|
@goiri The failed ut should not be caused by my modifications. |
|
@goiri hi, if no comments here,please help merge it. Thanks! |
|
We're closing this stale PR because it has been open for 100 days with no activity. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
Description of PR
seeAlso: https://issues.apache.org/jira/browse/HDFS-17438
At present, when the status of all namenodes in an ns in the router is the same, the namenode which is the newest reported will be placed at the top of the cache. when the client accesses the ns through the router, it will first access the namenode.
If multiple namenodes in this route are in an active state, or if there are namenodes with multiple observer states, the existing logic is not a problem, because the newest reported active or observer state namenode have a higher probability of being true active or observer compared to the namenode that reported active or observer state a long time ago.
Similarly, the newest reported namenode with a status of standby or unavailable has a higher probability of being a standby or unavailable namenode compared to the namenode reported with a status of standby or unavailable a long time ago. Therefore, the newest nn reported as standby or unavailable status should have a lower priority for access, the oldest nn reported as standby or unavailable status should have a higher priority for access.
How was this patch tested?
use TestNamenodeResolver#testRegistrationNamenodeSelection().
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?