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/04/13 00:36:25 UTC

[GitHub] [hadoop] xkrogen commented on a diff in pull request #4087: HDFS-16513. [SBN read] Observer Namenode should not trigger the edits rolling of active Namenode

xkrogen commented on code in PR #4087:
URL: https://github.com/apache/hadoop/pull/4087#discussion_r848971956


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java:
##########
@@ -1938,6 +1938,14 @@ public boolean isInStandbyState() {
         HAServiceState.OBSERVER == haContext.getState().getServiceState();
   }
 
+  public boolean isInObserverState() {
+    if (haContext == null || haContext.getState() == null) {
+      return haEnabled;

Review Comment:
   Seems like this was probably copied from `isInStandbyState()`? But I don't think it's right. If we can't find a state, we assume `STANDBY` state. If we assume `STANDBY` state because a valid state could not be found, then `isInObserverState()` should be false. So I think we should just `return false` here.



-- 
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