OmniaGM commented on code in PR #23639:
URL: https://github.com/apache/kafka/pull/23639#discussion_r4456042898


##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -1266,6 +1266,16 @@ public void processBatchEndOffset(long offset) {
         }
     }
 
+    public CompletableFuture<Void> forceRenounce() {
+        CompletableFuture<Void> future = new CompletableFuture<>();
+        appendControlEvent("forceRenounce", () -> {
+            if (isActiveController())
+                renounce();
+            future.complete(null);
+        });
+        return future;
+    }
+

Review Comment:
   Small one: am I right to say here that `forceRenounce` renounces whichever 
epoch is current when the event runs, not the epoch where the driver saw the 
conflict? If this node loses and wins leadership again in between, we would 
renounce the new term for no reason. It's harmless apart from an extra 
election, but would it be clearer to pass the epoch in and only renounce when 
`curClaimEpoch == epoch`? `LocalLogManager::resign` already ignores epochs that 
are too old in a similar way. WDYT?



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

Reply via email to