dineshchitlangia commented on a change in pull request #51: HDDS-2311. Fix logic of RetryPolicy in OzoneClientSideTranslatorPB. URL: https://github.com/apache/hadoop-ozone/pull/51#discussion_r340954388
########## File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/OMFailoverProxyProvider.java ########## @@ -205,36 +207,36 @@ private Text computeDelegationTokenService() { return new Text(rpcAddress.toString()); } - + @Override + public Class<OzoneManagerProtocolPB> getInterface() { + return OzoneManagerProtocolPB.class; + } /** * Called whenever an error warrants failing over. It is determined by the * retry policy. + * + * This is a dummy call from {@link RetryInvocationHandler}. The actual + * failover should be performed using either + * {@link OMFailoverProxyProvider#performFailoverIfRequired(String)} or + * {@link OMFailoverProxyProvider#performFailoverToNextProxy()}. + * + * In {@link OzoneManagerProtocolClientSideTranslatorPB}, we first + * manually failover and then call the RetryAction FAILOVER_AND_RETRY. This + * is done because we do not want to always failover to the next proxy. If we + * get a NotLeaderException with a suggested leader, then we want to + * failover to that OM proxy instead. Hence, we failover manually and the + * {@link FailoverProxyProvider#performFailover(Object)} call should not do + * failover again. */ @Override public void performFailover(OzoneManagerProtocolPB currentProxy) { - int newProxyIndex = incrementProxyIndex(); if (LOG.isDebugEnabled()) { LOG.debug("Failing over OM proxy to index: {}, nodeId: {}", - newProxyIndex, omNodeIDList.get(newProxyIndex)); + currentProxyIndex, omNodeIDList.get(currentProxyIndex)); } } Review comment: Findbugs Issue as explained in later comments near L273 ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org