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: [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]

Reply via email to