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


##########
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:
   There were a few reasons - I'm curious to know what you think
   - if the node re-transitions to follower, we need to remove the safeguard 
which currently prevents follower to follower transitions without an epoch bump
   - we save some extraneous actions which occur in transitionToFollower (e.g. 
no need to reset connections or use durable transition, we don't have any new 
state like leaderId or votedKey to persist)



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