You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/02/10 21:58:42 UTC

[GitHub] [hadoop] ayushtkn commented on a change in pull request #3976: HDFS-16452. msync RPC should send to acitve namenode directly

ayushtkn commented on a change in pull request #3976:
URL: https://github.com/apache/hadoop/pull/3976#discussion_r804141267



##########
File path: hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/ObserverReadProxyProvider.java
##########
@@ -368,6 +368,21 @@ private boolean shouldFindObserver() {
     return true;
   }
 
+  private void confirmActiveToMsync() throws IOException {
+    ClientProtocol activeProxy = (ClientProtocol) getCurrentProxy().proxy;
+    for (int i = 0; i < nameNodeProxies.size(); i++) {
+      NNProxyInfo<T> current = getCurrentProxy();
+      HAServiceState currState = current.getCachedState();
+      if (currState == HAServiceState.ACTIVE) {
+        activeProxy = getProxyAsClientProtocol(current.proxy);
+        LOG.info("active proxy is choosed :{}", current);
+        break;
+      } else {
+        changeProxy(current);

Review comment:
       hmm, the current proxy in observer proxy provider in general should be pointing to Observer namenode, you seems to change  the current proxy itself to active here? What would happen to subsequent calls, will they go to active or the concurrent calls

##########
File path: hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/ObserverReadProxyProvider.java
##########
@@ -342,7 +342,7 @@ private synchronized void initializeMsync() throws IOException {
     if (msynced) {
       return; // No need for an msync
     }
-    getProxyAsClientProtocol(failoverProxy.getProxy().proxy).msync();

Review comment:
       what does failoverProxy.getProxy().proxy points to?
   the same logic seems to be used for invocation as well
   ```
         // Either all observers have failed, observer reads are disabled,
         // or this is a write request. In any case, forward the request to
         // the active NameNode.
         LOG.debug("Using failoverProxy to service {}", method.getName());
         ProxyInfo<T> activeProxy = failoverProxy.getProxy();
         try {
           retVal = method.invoke(activeProxy.proxy, args);
         } catch (InvocationTargetException e) {
           // This exception will be handled by higher layers
           throw e.getCause();
         }
   ```




-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org