hadoop icon indicating copy to clipboard operation
hadoop copied to clipboard

HDFS-17438. RBF: The newest STANDBY and UNAVAILABLE nn should be the lowest priority.

Open KeeProMise opened this issue 11 months ago • 25 comments

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:

  • [x] Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • [ ] Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
  • [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • [ ] If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

KeeProMise avatar Mar 22 '24 03:03 KeeProMise