KAFKA-7509: Clean up incorrect warnings logged by Connect#11986
KAFKA-7509: Clean up incorrect warnings logged by Connect#11986C0urante wants to merge 3 commits intoapache:trunkfrom
Conversation
There was a problem hiding this comment.
We could potentially replace this with actual instantiation and configuration of the key, value, and header converters specified in the worker config, but that may be wasteful of resources (especially since the Converter interface doesn't extend Closeable yet) and it's unclear how we'd want to handle failures encountered during that process (aborting worker startup is not an option as converter instantiation may fail due to transient errors).
|
I've updated the approach to extract |
| keyWithPrefix = stringKey; | ||
| } else { | ||
| keyWithPrefix = prefix + stringKey; | ||
| } |
There was a problem hiding this comment.
Why not allow the concatenation when it is empty and thus get rid of the conditional?
| } else { | ||
| if (configState.offset() < assignment.offset()) { | ||
| log.warn("Catching up to assignment's config offset."); | ||
| log.info("Catching up to assignment's config offset."); |
There was a problem hiding this comment.
Great catch. Are there any other warns that should become infos elsewhere?
|
Closing due to lack of review. We can revisit in the future, although the downgrade of these log messages from |
Jira
Summary of changes
AbstractConfig::logUnusedmade by KafkaConsumer, KafkaProducer, and KafkaAdminClient instances when the original config map is an instance of a RecordingMapConsumerConfig::appendDeserializerToConfigandProducerConfig::appendSerializerToConfigto preserveRecordingMapinstances passed in to their constructors (or more precisely, create clones of those instances that retain the "recording" behavior of the original) so that all properties used by those consumers/producers are marked as used with the originalRecordingMapWorkerConfig::originalsas the baseline when constructing configs to pass to Kafka clients that are used by the worker to manage its internal Kafka topics, so that all properties in the worker config that are used by those Kafka clients are marked as used in theWorkerConfigproducer.andconsumer.prefixes, respectively)AbstractConfig::get(or one of its strongly-typed variants) or by invokingMap::geton the result ofAbstractConfig::originals(or one of its prefixed variants) (such as internal topic settings)WorkerConfigafter worker startup has taken placekey.converterthat are not used by the admin clientI also fixed a bug introduced in #8455 that causes a spurious warning to be logged when the worker config doesn't include a value for the
plugin.pathproperty.Testing
I've verified this locally with a variety of cases including typos in the worker config (
gorup.idinstead ofgroup.id), typos in connector client properties included in the worker config (producer.clinet.idinstead ofproducer.client.id), correctly-skipped connector client properties included in the worker config (consumer.max.poll.records), connector client interceptor properties included in the worker config (producer.interceptor.classes,some.interceptor.property.that.is.used,some.interceptor.property.that.is.not.used), use of the DLQ topic in a sink connector, and use of automatic topic creation in a source connector. If this approach looks reasonable, I can automate these tests, probably by capturing logging output during an integration test run and asserting that warnings were issued only for the expected set of properties.Edge cases
Note that the
RecordingMapclass is subtly broken at the moment in that it doesn't take into account calls toMap::forEach,Map::entrySet,Map::keySet,Map::values,Map::getOrDefault,Map::compute,Map::computeIfPresent, etc. This comes into play with cases like when custom settings are specified for internal topics (see TopicAdmin.NewTopicBuilder::config). We may not want to invest too heavily into this approach for controlling warning messages if we want to develop a truly flexible solution that can be easily used by both internal and external components.Committer Checklist (excluded from commit message)