showuon commented on code in PR #17147:
URL: https://github.com/apache/kafka/pull/17147#discussion_r1751666612


##########
metadata/src/main/java/org/apache/kafka/metadata/migration/KRaftMigrationDriver.java:
##########
@@ -519,7 +522,7 @@ public void run() throws Exception {
             KRaftMigrationDriver.this.image = image;
             String metadataType = isSnapshot ? "snapshot" : "delta";
 
-            if (migrationState.equals(MigrationDriverState.INACTIVE)) {
+            if (EnumSet.of(MigrationDriverState.UNINITIALIZED, 
MigrationDriverState.INACTIVE).contains(migrationState)) {
                 // No need to log anything if this node is not the active 
controller

Review Comment:
   Please update this comment.



##########
metadata/src/main/java/org/apache/kafka/metadata/migration/KRaftMigrationDriver.java:
##########
@@ -519,7 +522,7 @@ public void run() throws Exception {
             KRaftMigrationDriver.this.image = image;
             String metadataType = isSnapshot ? "snapshot" : "delta";
 
-            if (migrationState.equals(MigrationDriverState.INACTIVE)) {
+            if (EnumSet.of(MigrationDriverState.UNINITIALIZED, 
MigrationDriverState.INACTIVE).contains(migrationState)) {

Review Comment:
   Ah, nice! Not only `onControllerChange`, but all `OnMetadataChange` will 
cause race condition. 



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