kaijaytu opened a new pull request, #22984: URL: https://github.com/apache/kafka/pull/22984
Follow-up fix for #20384. When `internal.topics.automatic.creation.enable` is set to `false` and a connector-specific offset topic is missing, the error message incorrectly references the worker-level config `offset.storage.topic` instead of the connector-level config `offsets.storage.topic`. This is because `readWriteStore()` and `readOnlyStore()` create anonymous subclasses of `KafkaOffsetBackingStore` that do not override `getTopicConfig()`. This patch overrides `getTopicConfig()` in both factory methods to return `SourceConnectorConfig.OFFSETS_TOPIC_CONFIG` (`offsets.storage.topic`), so the error message correctly directs users to the relevant connector configuration. ### Changes - `KafkaOffsetBackingStore.java`: Override `getTopicConfig()` in `readWriteStore()` and `readOnlyStore()` anonymous classes to return the connector-level config key - Added `KafkaOffsetBackingStoreGetTopicConfigTest.java` to verify the fix ### Testing Unit tests verify that: 1. Worker-level `KafkaOffsetBackingStore` returns `offset.storage.topic` (unchanged behavior) 2. `readWriteStore()` now returns `offsets.storage.topic` (was incorrectly returning `offset.storage.topic`) 3. `readOnlyStore()` now returns `offsets.storage.topic` (was incorrectly returning `offset.storage.topic`) Existing tests (`KafkaOffsetBackingStoreTest`, `ConnectorOffsetBackingStoreTest`) pass with no regression. -- 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]
