Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Status

Current stateUnder DiscussionAccepted (vote thread)

Discussion thread: here (and the original discussion is here)

JIRA

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyKAFKA-7433

Released:  2.2

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Currently kafka-topics.sh uses only direct Zookeeper connections which is not really desired compared to the AdminClient. This change would aim to add capability to the TopicCommand to be able to connect to a broker using the AdminClient.

...

  • Allows clients in any language to administrate Kafka (Wire protocol is supported by any language)
  • Provides public client for performing admin operations
  • Ensures integration test code in other projects and clients maintains compatibility
  • Prevents users from needing to use the Command classes and work around standard output and system exits
  • Removing the need for admin scripts (kafka-configs.sh, kafka-topics.sh, etc) to talk directly to Zookeeper.
  • Allows ZNodes to be completely locked down via ACLs
  • Further hides the Zookeeper details of Kafka

...

The change proposed in this KIP is to add an extra option as stated above and to migrate create, delete, list and describe operations to use a broker connection. This would be a backward compatible change, meaning leaving the zookeeper option would be still available and fully working until a further point in time but hopefully would but would deprecate it as part of this KIP.

...

This KIP won't implement topic config alternation as that is deprecated in the TopicCommand and should be done by kafka-configs.shThe only alternation we allow is changing the partition number for topics.

...

Also retrieving the list of topics that are marked for deletion won't be implemented now as currently it's not possible to retrieve via any protocols. This conversation is part of KIP-142. The implementation will add a note regarding this in its output.

As part of the --zookeeper option deprecation we will mark it as deprecated in the command help but also print out a warning message about using this deprecated option.

Test Plan

The existing tests will be run with the --bootstrap-server mode too. Additionally we can refactor some of the kafka-topics.sh usages in the smokes to use the AdminClient mode.

...

Topics Marked For Deletion

...

Currently KafkaAdminClient.describeTopics() and KafkaAdminClient.listTopics() uses the Metadata protocol to acquire topic information. The returned response however won't contain the topics that are under deletion but couldn't complete yet (for instance because of some replicas offline), therefore it is not possible to implement the current command's "marked for deletion" feature. To get around this there were several alternatives that can be seen below but during the discussion we decided to keep this work in KIP-142. The idea in this KIP was that we could introduce some changes in the Metadata protocol, such as:

  • Cache topics that are under deletion but some of their replicas are offline.
  • Create a new error, called TOPIC__DELETION_IN_PROGRESS
  • Bump the Metadata request version. The format of the protocol won't change, only the fact that there is a new Error type that we're introducing, but that requires bumping the protocol as old clients won't be able to handle it and most probably end up in an UNKNOWN_SERVER_ERROR.
  • Smarten up the KafkaApis.handleTopicMetadataRequest to also return the list of topics under deletion with the above error

...