junrao commented on code in PR #22191:
URL: https://github.com/apache/kafka/pull/22191#discussion_r3684954406


##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -2153,6 +2157,21 @@ public CompletableFuture<Void> registerController(
             EnumSet.noneOf(ControllerOperationFlag.class));
     }
 
+    @Override
+    public CompletableFuture<Void> unregisterController(
+        ControllerRequestContext context,
+        int controllerId
+    ) {
+        return appendWriteEvent("unregisterController", context.deadlineNs(),
+            () -> {
+                if (nodeId == controllerId) {
+                    throw new InvalidRequestException("Controller cannot 
unregister itself while it is active.");
+                }
+                return clusterControl.unregisterController(controllerId);

Review Comment:
   The KIP says the following.
   ```
   Unregister a voter in a static KRaft quorum when the static voter set is 
mistakenly configured
   1. Stop the voter who was mistakenly put in controller.quorum.voters 
   2. Run kafka-cluster unregister-controller
   3. Ensure the stopped voter is not part of controller.quorum.voters on every 
Kafka node
   ```
   
   What will be the new sequence?



##########
core/src/test/scala/unit/kafka/server/ControllerRegistrationManagerTest.scala:
##########
@@ -120,6 +125,13 @@ class ControllerRegistrationManagerTest {
         }
       }
     }
+    if (metadataVersion.isControllerUnregistrationSupported) {
+     for (i <- Seq(1, 2, 3)) {

Review Comment:
   identation



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