[ 
https://issues.apache.org/jira/browse/KAFKA-18119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17902435#comment-17902435
 ] 

Greg Harris commented on KAFKA-18119:
-------------------------------------

There's a bit of a chicken-and-egg problem here:
 * Versioned#version() is a Java method, meaning that we need to finish 
ClassLoader#loadClass() in order to discover the version of a plugin.
 * Correctly implementing DelegatingClassLoader#loadClass() requires all 
Versioned#version() calls need to be finished to know exactly which version a 
the plugin to load.

We need to pick one to go first, or else we give up correctness.

> Service loading loads incorrect plugin version.
> -----------------------------------------------
>
>                 Key: KAFKA-18119
>                 URL: https://issues.apache.org/jira/browse/KAFKA-18119
>             Project: Kafka
>          Issue Type: Bug
>          Components: connect
>    Affects Versions: 3.6.0, 3.7.0, 3.6.1, 3.6.2, 3.8.0, 3.7.1, 3.9.0, 3.8.1
>            Reporter: Snehashis Pal
>            Priority: Major
>
> Kafka connect seems to be loading incorrect version of connect plugins (such 
> as connectors) if run in SERVICE_LOAD mode. If the worker is started with 
> only service loading enabled, it does not seem to be loading the latest 
> version of a plugin available in its plugins path. Rather it always seems to 
> be defaulting to the plugin version provided in the classpath. 
> I observed this when I placed an updated json-converter in the plugins path 
> and a connector instantiated, still defaulted to using the one provided in 
> the connect (Kafka) distribution. It does not happen when the older 
> reflections-based plugin scanner is used. This can be reproduced by following 
> the same process, noted down below
>  * Set {*}plugin.discovery{*}=SERVICE_LOAD
>  * Install a newer version of json-converter 
> ({*}org.apache.kafka.connect.json.JsonConverter{*}) than the one provided in 
> the distribution. Usually, the bundled version is the same as the current 
> Kafka distribution. 
>  * Start a connector with either *key.converter* or *value.converter* set to 
> the json converter. Without this in the config the latest version is loaded.
> It might be hard to judge which version of the converter is loaded. For 
> testing it might be good to build a new json converter with some log lines 
> depicting the version in use. Another way would be run connect in debug mode 
> and add some breakpoints in the startTask method in Worker where the 
> converters are initialised.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to