peterxcli commented on code in PR #11763:
URL: https://github.com/apache/ozone/pull/11763#discussion_r4476224493
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/OMFailoverProxyProviderBase.java:
##########
@@ -226,13 +226,9 @@ public RetryAction shouldRetry(Exception exception, int
retries,
if (notLeaderException != null) {
// Prepare the next OM to be tried. This will help with calculation
// of the wait times needed get creating the retryAction.
- String suggestedLeaderAddress =
- notLeaderException.getSuggestedLeaderAddress();
String suggestedNodeId =
notLeaderException.getSuggestedLeaderNodeId();
- if (suggestedLeaderAddress != null &&
- suggestedNodeId != null &&
- omProxies.contains(suggestedNodeId, suggestedLeaderAddress)) {
+ if (suggestedNodeId != null && omProxies.get(suggestedNodeId) !=
null) {
Review Comment:
good catch! fixed. thanks!
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/OMFailoverProxyProviderBase.java:
##########
@@ -226,13 +226,10 @@ public RetryAction shouldRetry(Exception exception, int
retries,
if (notLeaderException != null) {
// Prepare the next OM to be tried. This will help with calculation
// of the wait times needed get creating the retryAction.
- String suggestedLeaderAddress =
- notLeaderException.getSuggestedLeaderAddress();
String suggestedNodeId =
notLeaderException.getSuggestedLeaderNodeId();
- if (suggestedLeaderAddress != null &&
- suggestedNodeId != null &&
- omProxies.contains(suggestedNodeId, suggestedLeaderAddress)) {
+ if (suggestedNodeId != null && omProxies.get(suggestedNodeId) !=
null
+ && !isAttempted(suggestedNodeId)) {
Review Comment:
note: if same suggested leader appear again, then it must somehow down. Used
`!isAttempted(suggested Node Id)` here to give other nodes a chance in this
scenario.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]