showuon commented on code in PR #15732: URL: https://github.com/apache/kafka/pull/15732#discussion_r1568325101
########## metadata/src/main/java/org/apache/kafka/metadata/migration/KRaftMigrationDriver.java: ########## @@ -391,13 +391,16 @@ void enqueueMetadataChangeEvent( // Events handled by Migration Driver. abstract class MigrationEvent implements EventQueue.Event { + // Use no-op handler by default because the retryHandler will be overridden if needed + public void retryHandler() { } @SuppressWarnings("ThrowableNotThrown") @Override public void handleException(Throwable e) { if (e instanceof MigrationClientAuthException) { KRaftMigrationDriver.this.faultHandler.handleFault("Encountered ZooKeeper authentication in " + this, e); } else if (e instanceof MigrationClientException) { log.info(String.format("Encountered ZooKeeper error during event %s. Will retry.", this), e.getCause()); + retryHandler(); Review Comment: > My question is "why we did not handle UNINITIALIZED by another event"? If we move recoverMigrationStateFromZK to another event, we don't need to add extra retryHandler. That's a good quesiton, @chia7712 ! Let me think about it. > Also, the solution offered by this PR has a side effect that we will put 2 PollEvent if the exception MigrationClientException happens in other migrationState No, as you said above, the `MigrationClientException` won't happen in other migrationState because they will be handled in other event handler, which is not related to pollEvent. And because the default retryHandler is no-op, there will be no retry for other migrationStates. As long as `pollEvent` is keep polling, they can be retried later. -- 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