[ 
https://issues.apache.org/jira/browse/HDFS-16699?focusedWorklogId=797089&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-797089
 ]

ASF GitHub Bot logged work on HDFS-16699:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Aug/22 01:49
            Start Date: 02/Aug/22 01:49
    Worklog Time Spent: 10m 
      Work Description: goiri commented on code in PR #4663:
URL: https://github.com/apache/hadoop/pull/4663#discussion_r935043281


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java:
##########
@@ -483,10 +483,11 @@ public Object invokeMethod(
         final Object proxy = client.getProxy();
 
         ret = invoke(nsId, 0, method, proxy, params);
-        if (failover) {
+        if (failover && 
namenode.getState().equals(FederationNamenodeServiceState.STANDBY)) {

Review Comment:
   ```
   FederationNamenodeServiceState.STANDBY.equals(namenode.getState())
   ```
   Is usually safer.



##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java:
##########
@@ -483,10 +483,11 @@ public Object invokeMethod(
         final Object proxy = client.getProxy();
 
         ret = invoke(nsId, 0, method, proxy, params);
-        if (failover) {
+        if (failover && 
namenode.getState().equals(FederationNamenodeServiceState.STANDBY)) {
           // Success on alternate server, update
           InetSocketAddress address = client.getAddress();
           namenodeResolver.updateActiveNamenode(nsId, address);
+          LOG.info("Update ActiveNameNode,nsId = {},rpcAddress = {}.", nsId, 
rpcAddress);

Review Comment:
   Fix spaces in the log





Issue Time Tracking
-------------------

    Worklog Id:     (was: 797089)
    Time Spent: 1h 10m  (was: 1h)

> RBF: Router Update Observer NameNode state to Active when failover because of 
>  sockeTimeOut  Exception
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-16699
>                 URL: https://issues.apache.org/jira/browse/HDFS-16699
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: rbf
>    Affects Versions: 3.1.1
>            Reporter: ShuangQi Xia
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> we found that ,router print logs that indicate  Observer NameNode  state 
> changed to active always,here's the log
> 2022-03-18 11:00:54,589 | INFO  | NamenodeHeartbeatService hacluster 11342-0 
> | NN registration state has changed: 
> test101:25019->hacluster:11342:test103:25000-ACTIVE -> 
> test102:25019->hacluster:11342::test103:25000-OBSERVER | 
> MembershipStoreImpl.java:170
> for code ,I fount that , when router request failed for some reson ,like 
> sockettimeout Excetion , failover to Observer NameNode,will  update it's 
> state to Active
>    if (failover) {
>           // Success on alternate server, update
>           InetSocketAddress address = client.getAddress();
>           namenodeResolver.updateActiveNamenode(nsId, address);
>        }



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to