mwesterby commented on code in PR #23639:
URL: https://github.com/apache/kafka/pull/23639#discussion_r4526793156
##########
core/src/main/scala/kafka/server/ControllerServer.scala:
##########
@@ -304,6 +304,17 @@ class ControllerServer(
fatal = false,
() => {}
))
+
.setMigrationConflictFaultHandler(sharedServer.faultHandlerFactory.build(
+ "zk migration conflict",
+ fatal = false,
+ () => {
+ try {
+ controller.forceRenounce().get(10, TimeUnit.SECONDS)
+ } catch {
+ case e: TimeoutException =>
sharedServer.fatalQuorumControllerFaultHandler.handleFault("Failed to renounce
leadership", e)
Review Comment:
When we move to `INACTIVE`, the controller still maintains leadership, and
keeps accepting and committing metadata changes. Only the driver's role,
mirroring to ZK and sending RPCs to ZK-mode brokers, stops. Nothing will
reactivate the migration driver until there is a leadership change. The longer
we exist in this state the longer the states in KRaft and ZK can diverge.
Having a timeout here acts as a fail-safe to ensure a new controller will be
elected to restart the driver once more and prevent a scenario where the states
can keep diverging until the event reaches the front of the queue (should this
take an exceptionally long time). I think 10 seconds is reasonable that this
should only fire in exceptional circumstances.
--
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]