KAFKA-14909: check zkMigrationReady tag before migration (#13631)
1. add ZkMigrationReady in apiVersionsResponse
2. check all nodes if ZkMigrationReady are ready before moving to next migration state
Reviewers: David Arthur <mumrah@gmail.com>, dengziming <dengziming1993@gmail.com>
@ -119,7 +119,8 @@ public class ApiVersionsResponse extends AbstractResponse {
@@ -119,7 +119,8 @@ public class ApiVersionsResponse extends AbstractResponse {
@ -131,7 +132,8 @@ public class ApiVersionsResponse extends AbstractResponse {
@@ -131,7 +132,8 @@ public class ApiVersionsResponse extends AbstractResponse {
@ -139,20 +141,22 @@ public class ApiVersionsResponse extends AbstractResponse {
@@ -139,20 +141,22 @@ public class ApiVersionsResponse extends AbstractResponse {
@ -163,7 +167,8 @@ public class ApiVersionsResponse extends AbstractResponse {
@@ -163,7 +167,8 @@ public class ApiVersionsResponse extends AbstractResponse {
longfinalizedFeaturesEpoch,
NodeApiVersionscontrollerApiVersions,
ListenerTypelistenerType,
booleanenableUnstableLastVersion
booleanenableUnstableLastVersion,
booleanzkMigrationEnabled
){
ApiVersionCollectionapiKeys;
if(controllerApiVersions!=null){
@ -186,7 +191,8 @@ public class ApiVersionsResponse extends AbstractResponse {
@@ -186,7 +191,8 @@ public class ApiVersionsResponse extends AbstractResponse {
apiKeys,
latestSupportedFeatures,
finalizedFeatures,
finalizedFeaturesEpoch
finalizedFeaturesEpoch,
zkMigrationEnabled
);
}
@ -195,7 +201,8 @@ public class ApiVersionsResponse extends AbstractResponse {
@@ -195,7 +201,8 @@ public class ApiVersionsResponse extends AbstractResponse {
@ -204,7 +211,8 @@ public class ApiVersionsResponse extends AbstractResponse {
@@ -204,7 +211,8 @@ public class ApiVersionsResponse extends AbstractResponse {
apiVersions,
latestSupportedFeatures,
finalizedFeatures,
finalizedFeaturesEpoch
finalizedFeaturesEpoch,
zkMigrationEnabled
)
);
}
@ -294,7 +302,8 @@ public class ApiVersionsResponse extends AbstractResponse {
@@ -294,7 +302,8 @@ public class ApiVersionsResponse extends AbstractResponse {
@ -303,6 +312,7 @@ public class ApiVersionsResponse extends AbstractResponse {
@@ -303,6 +312,7 @@ public class ApiVersionsResponse extends AbstractResponse {
@ -91,6 +93,7 @@ public class KRaftMigrationDriver implements MetadataPublisher {
@@ -91,6 +93,7 @@ public class KRaftMigrationDriver implements MetadataPublisher {
@ -99,15 +102,17 @@ public class KRaftMigrationDriver implements MetadataPublisher {
@@ -99,15 +102,17 @@ public class KRaftMigrationDriver implements MetadataPublisher {
@ -116,8 +121,22 @@ public class KRaftMigrationDriver implements MetadataPublisher {
@@ -116,8 +121,22 @@ public class KRaftMigrationDriver implements MetadataPublisher {
@ -149,6 +168,15 @@ public class KRaftMigrationDriver implements MetadataPublisher {
@@ -149,6 +168,15 @@ public class KRaftMigrationDriver implements MetadataPublisher {
@ -432,9 +460,11 @@ public class KRaftMigrationDriver implements MetadataPublisher {
@@ -432,9 +460,11 @@ public class KRaftMigrationDriver implements MetadataPublisher {
transitionTo(MigrationDriverState.INACTIVE);
break;
casePRE_MIGRATION:
// Base case when starting the migration
log.debug("Controller Quorum is ready for Zk to KRaft migration. Now waiting for ZK brokers.");