Vahid Hashemian commented on KAFKA-7037:

The reason is the {{--topic}} option also accepts regular expressions. In your 
example `+` is a regex symbol and the {{–delete --topic test+topic}} would 
delete topics {{testtopic}}, {{testttopic}}, {{testtttopic}}, etc. To escape 
regular expression, the topic name should be places in double quotes, and regex 
symbols should be prefixed with a {{\}}.

> delete topic command replaces '+' from the topic name which leads incorrect 
> topic deletion
> ------------------------------------------------------------------------------------------
>                 Key: KAFKA-7037
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7037
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions:, 1.0.0
>            Reporter: Sandeep Nemuri
>            Assignee: Vahid Hashemian
>            Priority: Major
> While executing a delete command kafka cli tool is removing the "+" symbol 
> and deleting the incorrect topic. In below case if  _"*test+topic"*_ is 
> deleted kafka deletes  _*testtopic.*_
> {code:java}
> [kafka@localhost~]$ /usr/hdp/current/kafka-broker/bin/kafka-topics.sh 
> --create --zookeeper `hostname`:2181 --replication-factor 1 --partitions 1 
> --topic testtopic
> Created topic "testtopic".
> [kafka@localhost~]$ /usr/hdp/current/kafka-broker/bin/kafka-topics.sh 
> --zookeeper `hostname`:2181 --topic test+topic --delete
> Topic testtopic is marked for deletion.{code}
>  delete topic replaces '+' from the topic name  

This message was sent by Atlassian JIRA

Reply via email to