Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added KRaftControllerId to StopReplicas

...

In addition to checking if a broker is ready for migration, these new properties are used by the KRaft controller to verify that the brokers and new KRaft controllers have valid configurations. 

UpdateMetadataRequest

Controller RPCs

For the three ZK controller RPCs UpdateMetadataRequest, LeaderAndIsrRequest, and StopReplicaRequest a new KRaftControllerId field A new RPC version will be added which adds the field KRaftControllerId. This field will point to the active KRaft controller and will only be set when the controller is in KRaft mode. If this field is set, the ControllerId field should be -1. 

Code Block
{
  "apiKey": 64,
  "type": "request",
  "listeners": ["zkBroker"],
  "name": "UpdateMetadataRequestLeaderAndIsrRequest",
  "validVersions": "0-87",  <-- New version 87
  "flexibleVersions": "64+",
  "fields": [
    { "name": "ControllerId", "type": "int32", "versions": "0+", "entityType": "brokerId",
      "about": "The controller id." },
--> { "name": "KRaftControllerId", "type": "int32", "versions": "87+", "entityType": "brokerId",
      "about": "The KRaft controller id, used during migration." }, <-- New field
    { "name": "ControllerEpoch", "type": "int32", "versions": "0+",
      "about": "The controller epoch." },
    ...
   ]
}

ApiVersionsResponse

...


Code Block
{
  "apiKey": 185,
  "type": "responserequest",
  "namelisteners": "ApiVersionsResponse["zkBroker"],
  "name": "StopReplicaRequest",
  "validVersions": "0-4",   // <-- New version 4
  "flexibleVersions": "32+",
  "fields": [
    ...
    { "name": "ZkMigrationReadyControllerId", "type": "int8int32", "versions": "40+", "taggedVersionsentityType": "4+brokerId", "tag": 3, "ignorable": true,
      "about": "SetThe bycontroller a KRaft controller if the required configurations for ZK migration are present" }
  ]
}

This field will only be set by the KRaft controller when sending ApiVersionsResponse to other KRaft controllers. Since this migration does not support combined mode KRaft nodes, this field will never be seen by clients when receiving ApiVersionsResponse sent by brokers.

LeaderAndIsrRequest

A new RPC version will be added which adds the field KRaftControllerId. This field will point to the active KRaft controller. If this field is set, the ControllerId field should be -1.

id." },
--> { "name": "KRaftControllerId", "type": "int32", "versions": "4+", "entityType": "brokerId",
      "about": "The KRaft controller id, used during migration." }, <-- New field
    { "name": "ControllerEpoch", "type": "int32", "versions": "0+",
      "about": "The controller epoch." },
    ...
   ]
}


Code Block
{
  "apiKey": 6,
  "type": "request",
  "listeners": ["zkBroker"],
  "name": "UpdateMetadataRequest",
  "validVersions": "0-8",  <-- New version 8
  "flexibleVersions": "6+",
  "fields": [
    { "name": "ControllerId", "type": "int32", "versions": "0+", "entityType": "brokerId",
      "about": "The controller id." },
--> { "name": "KRaftControllerId", "type": "int32", "versions": "8+", "entityType": "brokerId",
      "about": "The KRaft controller id, used during migration." }, <-- New field
    { "name": "ControllerEpoch", "type": "int32", "versions": "0+",
      "about": "The controller epoch." },
    ...
   ]
}

ApiVersionsResponse

A new tagged field on ApiVersionsResponse will be added to allow KRaft controllers to indicate their ability to perform the migration

Code Block
{
  "apiKey": 18,
  "type": "response",
  "name": "ApiVersionsResponse",
  "validVersions": "0-4",   // <-- New version 4
  "flexibleVersions": "3+",
  "fields": [
    ...
Code Block
{
  "apiKey": 4,
  "type": "request",
  "listeners": ["zkBroker"],
  "name": "LeaderAndIsrRequest",
  "validVersions": "0-7", 	// <-- New version 7
  "flexibleVersions": "4+",
  "fields": [
    { "name": "ControllerId", "type": "int32", "versions": "0+", "entityType": "brokerId",
      "about": "The current controller ID." },
--> { "name": "KRaftControllerId", "type": "int32", "versions": "8+", "entityType": "brokerId",
      "about": "The KRaft controller id, used during migration." }, <-- New field
    { "name": "ControllerEpochZkMigrationReady", "type": "int32int8", "versions": "4+", "taggedVersions": "0+"4+", "tag": 3, "ignorable": true,
      "about": "The currentSet by a KRaft controller epoch." },
    ...if the required configurations for ZK migration are present" }
  ]
}

This field will only be set by the KRaft controller when sending ApiVersionsResponse to other KRaft controllers. Since this migration does not support combined mode KRaft nodes, this field will never be seen by clients when receiving ApiVersionsResponse sent by brokers.

Migration Metadata Record

...