From 879062631e5aa6afd55b25b2b48230e26ad92b15 Mon Sep 17 00:00:00 2001 From: David Arthur Date: Mon, 9 Sep 2024 21:31:36 -0400 Subject: [PATCH] Handle another init race --- .../apache/kafka/metadata/migration/KRaftMigrationDriver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata/src/main/java/org/apache/kafka/metadata/migration/KRaftMigrationDriver.java b/metadata/src/main/java/org/apache/kafka/metadata/migration/KRaftMigrationDriver.java index ac63a66a08934..e6814a41e20fb 100644 --- a/metadata/src/main/java/org/apache/kafka/metadata/migration/KRaftMigrationDriver.java +++ b/metadata/src/main/java/org/apache/kafka/metadata/migration/KRaftMigrationDriver.java @@ -522,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 completionHandler.accept(null); return;