ahuang98 commented on code in PR #19854:
URL: https://github.com/apache/kafka/pull/19854#discussion_r2231846413


##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -2569,13 +2569,15 @@ private void maybeTransition(
             } else {
                 transitionToUnattached(epoch, OptionalInt.empty());
             }
-        } else if (
-                leaderId.isPresent() &&
-                (!quorum.hasLeader() || leaderEndpoints.size() > 
quorum.leaderEndpoints().size())
-        ) {
-            // The request or response indicates the leader of the current 
epoch
-            // which are currently unknown or the replica has discovered more 
endpoints
-            transitionToFollower(epoch, leaderId.getAsInt(), leaderEndpoints, 
currentTimeMs);
+        } else if (leaderId.isPresent()) {
+            if (quorum.isFollowerObserver()) {

Review Comment:
   discussed offline, pushed a new commit with a more clean method!



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to