wombatu-kun opened a new pull request, #16602: URL: https://github.com/apache/iceberg/pull/16602
Closes #16601 ### Problem `KafkaMetadataTransform` held its configuration (`recordAppender`) in a `static` field, so every instance in a worker JVM shared one configuration and the last `configure()` call won. Two differently-configured instances (two connectors that use the SMT, or two transform aliases in one chain) would emit each other's metadata field names and structure. It is also a thread-safety hazard, since the field is mutated from each task's `configure()` and read from each task's `apply()`. The other SMTs in the module (`CopyValue`, `DebeziumTransform`) already use instance fields. ### Solution Make `recordAppender` an instance field. All reads are in instance methods, so the change is minimal, and the appender is still built once per instance in `configure()`, so there is no added cost. ### Tests Added `TestKafkaMetadataTransform.testConfigIsNotSharedAcrossInstances`: it configures two instances with different field names and verifies each instance uses its own configuration. It fails before the change and passes after. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
