DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
- Broker static reporting: Brokers report their static (non-sensitive) configurations to the controller during registration. This enables the controller to perform pre-flight validation of static configs during metadata version upgrades.
- Metadata-Version-Aware Validators::Configuration definitions can now specify validators that apply at specific metadata version feature levels. The enhance to support metadata-version-aware validators. The ConfigDef.define() method accepts a mvValidators parameter — a map from feature level (short) to ConfigDef.Validator instances.
- When a broker attempts to register to with the cluster, if it has illegal config, the controller should reject its join.
- When alterConfig and incrementalAlterConfig, metadata-version validator should be called to check new config is satisfy to metadata version requirements.
- the Controller must audit its static configurations stored in the
BrokerRegistrationRequest. If any configuration violates the constraints of the current activemetadata.version, the Controller will reject the registration, preventing the broker from joining the cluster in an inconsistent state. - During
AlterConfigsandIncrementalAlterConfigsoperations, the Metadata-Version-Aware validators will be invoked to ensure that any proposed changes are compliant with the cluster's current metadata version. Any configuration that fails this runtime validation will be rejected with anINVALID_CONFIGerror. - When an administrator performs a
metadata.versionupgrade or downgrade, the Controller will execute a comprehensive audit of all existing configurations—both static (viaBrokerRegistrationRecord) and dynamic (viaConfigRecord). The transition will only proceed if all current settings satisfy the constraints of the target metadata version, ensuring a safe and atomic version migrationWhen admin.upgrade and downgrade, all configurations (static config and dynamic config) should be validated it is satisfy to metadata version requirements.
Public Interfaces
ConfigDef
We add are introducing a new field mvValidator to make configuration can be validated according to metadata version.mvValidators field to the ConfigDef class, enabling configurations to be validated against specific metadata.version thresholds. This allows the system to enforce version-specific constraints dynamically as the cluster evolves.
| Code Block | ||||
|---|---|---|---|---|
| ||||
public static class ConfigKey {
public final String name;
public final Type type;
public final String documentation;
public final Object defaultValue;
public final Validator validator;
public final Importance importance;
public final String group;
public final int orderInGroup;
public final Width width;
public final String displayName;
public final List<String> dependents;
public final Recommender recommender;
public final boolean internalConfig;
public final String alternativeString;
public final NavigableMap<Short, Validator> mvValidators; // new field
...
} |
BrokerRegistrationRequest
Bump We propose to bump BrokerRegistrationRequest and BrokerRegistrationResponse to add static configuration fieldsa new version to include a map of static configurations. This allows brokers to report their local server.properties settings to the Controller during the registration phase.
| Code Block | ||||
|---|---|---|---|---|
| ||||
diff --git a/clients/src/main/resources/common/message/BrokerRegistrationRequest.json b/clients/src/main/resources/common/message/BrokerRegistrationRequest.json
index 53e37f21d5..cdd53c4466 100644
--- a/clients/src/main/resources/common/message/BrokerRegistrationRequest.json
+++ b/clients/src/main/resources/common/message/BrokerRegistrationRequest.json
@@ -18,12 +18,13 @@
// Version 3 adds the PreviousBrokerEpoch for the KIP-966
// Version 4 fixes KAFKA-17011, which blocked SupportedFeatures.MinVersion in the response from being 0.
// Version 5 adds the CordonedLogDirs flexible field
+// Version 6 adds StaticConfigs for broker static config reporting.
{
"apiKey":62,
"type": "request",
"listeners": ["controller"],
"name": "BrokerRegistrationRequest",
- "validVersions": "0-5",
+ "validVersions": "0-6",
"flexibleVersions": "0+",
"fields": [
{ "name": "BrokerId", "type": "int32", "versions": "0+", "entityType": "brokerId",
@@ -63,6 +64,15 @@
{ "name": "PreviousBrokerEpoch", "type": "int64", "versions": "3+", "default": "-1", "ignorable": true,
"about": "The epoch before a clean shutdown." },
{ "name": "CordonedLogDirs", "type": "[]uuid", "versions": "5+", "taggedVersions": "5+",
- "tag": "0", "about": "Log directories that are cordoned." }
+ "tag": "0", "about": "Log directories that are cordoned." },
+ { "name": "StaticConfigs", "type": "[]StaticConfig", "versions": "6+",
+ "about": "static configs from the broker's server.properties and default value.", "fields": [
+ { "name": "Name", "type": "string", "versions": "6+",
+ "about": "The config name." },
+ { "name": "Value", "type": "string", "versions": "6+", "nullableVersions": "6+",
+ "about": "The config value. Null if the config is sensitive." }
+ ]}
]
}
|
| Code Block | ||||||
|---|---|---|---|---|---|---|
| ||||||
// Version 1 adds Zk broker epoch to the request if the broker is migrating from Zk mode to KRaft mode.
// Version 2 adds the PreviousBrokerEpoch to the request for the KIP-966
// Version 3 is the same as version 2 (new field in request).
// Version 4 is the same as version 2 (new field in request).
// Version 5 is the same as version 2 (new field in request).
// Version 6 is the same as version 2 (new field in request).
{
"apiKey": 62,
"type": "response",
"name": "BrokerRegistrationResponse",
+ "validVersions": "0-6",
- "validVersions": "0-5",
"flexibleVersions": "0+",
"fields": [
{ "name": "ThrottleTimeMs", "type": "int32", "versions": "0+",
"about": "Duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota." },
{ "name": "ErrorCode", "type": "int16", "versions": "0+",
"about": "The error code, or 0 if there was no error." },
{ "name": "BrokerEpoch", "type": "int64", "versions": "0+", "default": "-1",
"about": "The broker's assigned epoch, or -1 if none was assigned." }
]
} assigned." }
]
} |
BrokerRegistrationRecord
We propose updating RegisterBrokerRecord to Version 5. This version introduces a new tagged field StaticConfigs, which is a collection of BrokerStaticConfig objects. This allows the Controller to persist the broker's reported static settings directly within the metadata log.
| Code Block | ||||
|---|---|---|---|---|
| ||||
diff --git a/metadata/src/main/resources/common/metadata/RegisterBrokerRecord.json b/metadata/src/main/resources/common/metadata/RegisterBrokerRecord.json index b7db680cbd..5570cbd96f 100644 --- a/metadata/src/main/resources/common/metadata/RegisterBrokerRecord.json +++ b/metadata/src/main/resources/common/metadata/RegisterBrokerRecord.json @@ -17,11 +17,12 @@ // Version 2 adds IsMigratingZkBroker // Version 3 adds LogDirs // Version 4 adds CordonedLogDirs +// Version 5 adds StaticConfigs for broker static config reporting. { "apiKey": 0, "type": "metadata", "name": "RegisterBrokerRecord", - "validVersions": "0-4", + "validVersions": "0-5" config reporting. { "apiKey": 0, "flexibleVersionstype": "0+metadata", "fields": [ { "name": "BrokerIdRegisterBrokerRecord", - "typevalidVersions": "int32",0-4", + "versionsvalidVersions": "0+-5", "entityTypeflexibleVersions": "brokerId0+", @@ -61,6 +62,16 @@ "fields": [ { "name": "LogDirs", "type": "[]uuid", "versions": "3+BrokerId", "taggedVersionstype": "3+int32", "tagversions": "0+", "about"entityType": "brokerId"Log directories configured in this broker which are available." },, @@ -61,6 +62,16 @@ { "name": "CordonedLogDirsLogDirs", "type": "[]uuid", "versions": "43+", "taggedVersions": "43+", "tag": "1"0, - "about": "Log directories thatconfigured in this broker which are cordonedavailable." }, + { "aboutname": "Log directories that are cordoned." }, + { "name": "StaticConfigsCordonedLogDirs", "type": "[]uuid", "versions": "4+", "typetaggedVersions": "[]BrokerStaticConfig4+", "versionstag": "5+1", +- "taggedVersionsabout": "5+", "tag": 2,Log directories that are cordoned." } + "about": "Non-defaultLog staticdirectories configsthat reported by the broker.", "fields": [ + are cordoned." }, + { "name": "NameStaticConfigs", "type": "string[]BrokerStaticConfig", "versions": "5+", + "taggedVersions": "5+", "tag": 2, + "about": "The config name." },Non-default static configs reported by the broker.", "fields": [ + { "name": "ValueName", "type": "string", "versions": "5+", "nullableVersions": "5+", + "about": "The config value. Null if the config is sensitive.name." }, + { "name": "IsSensitiveValue", "type": "boolstring", "versions": "5+", "defaultnullableVersions": "false5+", + "about": "TrueThe config value. Null if thisthe configurationconfig is sensitive." }, + ]} ] } |
Compatibility, Deprecation, and Migration Plan
...