You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "dengziming (via GitHub)" <gi...@apache.org> on 2023/05/31 08:41:01 UTC

[GitHub] [kafka] dengziming commented on a diff in pull request #13777: KAFKA-15036: UnknownServerError on any leader failover

dengziming commented on code in PR #13777:
URL: https://github.com/apache/kafka/pull/13777#discussion_r1211294473


##########
core/src/test/scala/integration/kafka/server/KRaftClusterTest.scala:
##########
@@ -96,6 +96,32 @@ class KRaftClusterTest {
     }
   }
 
+  @Test
+  def testCreateClusterAndRestartControllerNode(): Unit = {

Review Comment:
   @soarez Yes, we shutdown the active controller, then restart it to make it send `ApiVersionRequest` to a standby controller.



##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -2028,8 +2028,11 @@ public CompletableFuture<FinalizedControllerFeatures> finalizedFeatures(
         if (lastCommittedOffset == -1) {
             return CompletableFuture.completedFuture(new FinalizedControllerFeatures(Collections.emptyMap(), -1));
         }
+        // It's possible for a standby controller to receiving ApiVersionRequest and we do not have any timeline snapshot
+        // in a standby controller, in this case we use Long.MAX_VALUE.
+        long epoch = isActive() ? lastCommittedOffset : Long.MAX_VALUE;

Review Comment:
   good suggestion.



-- 
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-unsubscribe@kafka.apache.org

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