0xffff-zhiyan opened a new pull request, #21053:
URL: https://github.com/apache/kafka/pull/21053

   ### Problem
   https://issues.apache.org/jira/browse/KAFKA-19851
   When upgrading from Kafka 3.x to 4.0, the metadata log may contain dynamic 
configurations that were removed in 4.0 (e.g., `message.format.version` per 
KIP-724). These removed configs cause `InvalidConfigurationException` when 
users attempt to modify any configuration, because validation checks all 
existing configs including the removed ones.
   
   ### Implementation
   
   Implement whitelist-based filtering to automatically remove invalid/removed 
configurations during metadata image building and replay:
   
   1. `KafkaConfigSchema.validConfigNames()` - Returns whitelist of valid 
non-internal config names per resource type
   2. Filter in `ConfigurationsDelta` - Filter invalid configs when replaying 
`ConfigRecord` and building final image
   3. Filter in `ConfigurationControlManager` - Filter invalid configs during 
replay to keep controller state clean
   4. Add `GROUP` and `CLIENT_METRICS` ConfigDefs to `KafkaRaftServer` for 
complete whitelist
   
   ### Changes
   
   - `KafkaConfigSchema`: Added `validConfigNames()` method
   - `ConfigurationsDelta`/`ConfigurationDelta`: Filter invalid configs in 
`replay()` and `apply()`
   - `ConfigurationControlManager`: Filter invalid configs in `replay()`
   - `KafkaRaftServer`: Added GROUP and CLIENT_METRICS ConfigDefs
   - Tests: Added unit tests verifying filtering behavior
   
   ### Testing
   
   - Removed configs are filtered from base images and during replay
   - Explicitly setting a removed config still triggers 
`InvalidConfigurationException`


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