Status
Current state: Adopted
Discussion thread: here
JIRA: KAFKA-4291
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
KIP Authors: Edoardo Comar and Mickael Maison
Motivation
When using TopicCommand --describe
, it does not show if a topic is marked for deletion. Such information is only displayed when using --list
. It would be helpful to have the --describe
command include all details instead of having to go back and forth between multiple commands.
Moreover when using TopicCommand --describe
with --under-replicated-partitions
or --unavailable-partitions
, topics marked for deletion are listed without being marked appropriately which can be confusing!
Public Interfaces
The change would only be in the output of TopicCommand when using the --describe
flag. This is the class called by the kafka-topics.sh
script.
Proposed Changes
If a topic is marked for deletion, --describe
will return the following:
Topic:testtopic PartitionCount:1 ReplicationFactor:1 Configs:cleanup.policy=compact,flush.ms=1000 MarkedForDeletion:true
Topic: testtopic Partition: 0 Leader: none Replicas: 0 Isr:
When running with --unavailable-partitions or --under-replicated-partitions, the topic header is not displayed. In this case, the marker will be added on each partition:
Topic: testtopic Partition: 0 Leader: none Replicas: 0 Isr: MarkedForDeletion:true
Compatibility, Deprecation, and Migration Plan
- What impact (if any) will there be on existing users?
There is a concern that people may be parsing the raw output as there is no structured output from this command. In that case, people will need to adjust their parsing logic.
Rejected Alternatives
We tried reusing the same string used by --list
("- marked for deletion") but we found the output inconsistent compared to the other fields in --describe
.
Topic:testtopic PartitionCount:1 ReplicationFactor:1 Configs:cleanup.policy=compact,flush.ms=1000 - marked for deletion
Topic: testtopic Partition: 0 Leader: none Replicas: 0 Isr: