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


##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -2543,13 +2543,16 @@ 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()) {
+                // This allows observers to resume fetching from leader after 
discovering the leader
+//                transitionToFollower(epoch, leaderId.getAsInt(), 
leaderEndpoints, currentTimeMs);

Review Comment:
   alternative solution, with allowance for follower to follower transition for 
observers only



##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -2543,13 +2543,16 @@ 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()) {
+                // This allows observers to resume fetching from leader after 
discovering the leader
+//                transitionToFollower(epoch, leaderId.getAsInt(), 
leaderEndpoints, currentTimeMs);

Review Comment:
   alternative solution, needing allowance for follower to follower transition 
for observers only



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