kafka/tests/kafkatest
Randall Hauch 3bc5ee7dd1 KAFKA-5704: Corrected Connect distributed startup behavior to allow older brokers to auto-create topics
When a Connect distributed worker starts up talking with broker versions 0.10.1.0 and later, it will use the AdminClient to look for the internal topics and attempt to create them if they are missing. Although the AdminClient was added in 0.11.0.0, the AdminClient uses APIs to create topics that existed in 0.10.1.0 and later. This feature works as expected when Connect uses a broker version 0.10.1.0 or later.

However, when a Connect distributed worker starts up using a broker older than 0.10.1.0, the AdminClient is not able to find the required APIs and thus will throw an UnsupportedVersionException. Unfortunately, this exception is not caught and instead causes the Connect worker to fail even when the topics already exist.

This change handles the UnsupportedVersionException by logging a debug message and doing nothing. The existing producer logic will get information about the topics, which will cause the broker to create them if they don’t exist and broker auto-creation of topics is enabled. This is the same behavior that existed prior to 0.11.0.0, and so this change restores that behavior for brokers older than 0.10.1.0.

This change also adds a system test that verifies Connect works with a variety of brokers and is able to run source and sink connectors. The test verifies that Connect can read from the internal topics when the connectors are restarted.

Author: Randall Hauch <rhauch@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #3641 from rhauch/kafka-5704

(cherry picked from commit 1a653c813c)
Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
2017-08-08 20:20:54 -07:00
..
benchmarks MINOR: log4j template should accept log_level 2017-06-07 16:52:20 +01:00
directory_layout KAFKA-4450; Add upgrade tests for 0.10.1 and rename TRUNK to DEV_BRANCH to reduce confusion 2017-01-28 01:40:34 +00:00
sanity_checks MINOR: Fix race condition in TestVerifiableProducer sanity test 2017-05-21 18:23:37 -07:00
services MINOR: support retrieving cluster_id in system tests 2017-08-08 19:59:12 -07:00
tests KAFKA-5704: Corrected Connect distributed startup behavior to allow older brokers to auto-create topics 2017-08-08 20:20:54 -07:00
utils MINOR: Fix race condition in TestVerifiableProducer sanity test 2017-05-21 18:23:37 -07:00
__init__.py MINOR: Bump version to 0.11.0.1-SNAPSHOT 2017-07-28 15:22:31 -07:00
version.py KAFKA-5281; System tests for transactions 2017-06-01 10:27:01 -07:00