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

Murad M commented on KAFKA-7930:
--------------------------------

{quote}
This should not have happened... Note that, all internal topic should not be 
read/written by any other application. If you want to share data, you should 
always create your own topics and write to them via `to()` or `through()`.
{quote}

That is the point, if there would be some internal flag that would identify 
that this topic is internal, then ok. But now it treats that topic as internal 
by pattern, hoping that it was generated correctly in advance, and user did not 
come up with arbitrary topic name that accidentally matches this pattern or 
changed the intention of previously name auto-generated topic. 

On the other hand, currently if you specify such topic in `--input-topics` or 
`--intermediate-topics`, then tool will first treat it as specified (apply the 
offset reset to latest/earliest) and then because it is also `isInternalTopic` 
will delete it. Which is somewhat weird.

Also, delete is fast and irreversible... Should not be that easy I think..

{quote}
For this case, you could use `bin/kafka-consumer-group.sh` instead of stream 
reset tool. Thus, I am wondering if we should patch the reset tool at all, as 
there is an alternative tool you can use?
{quote}

Possible, and was considered, but we had to:
a) read the code of both tools to make sure that they are doing same thing, 
because no documentation states that they are interchangeable.
b) `kafka-consumer-group.sh` works on per topic basis, while 
`kafka-streams-application-reset.sh` works on multiple topics, which is more 
convenient.
c) `kafka-streams-application-reset.sh` is intended tool for this, while 
`kafka-consumer-group.sh` seems like more "low level" and may work outside of 
context of streams.

Somehow, it was cheaper / faster patch `StreamsResetter` than use 
`kafka-consumer-group.sh`.

> StreamsResetter makes "changelog" topic naming assumptions
> ----------------------------------------------------------
>
>                 Key: KAFKA-7930
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7930
>             Project: Kafka
>          Issue Type: Improvement
>          Components: streams, tools
>    Affects Versions: 2.1.0
>            Reporter: Murad M
>            Priority: Major
>              Labels: features, needs-kip, patch-available, usability
>
> StreamsResetter deletes the topics considered internal. Currently it just 
> checks the naming as per 
> [code|https://github.com/apache/kafka/blob/1aae604861068bb7337d4972c9dcc0c0a99c374d/core/src/main/scala/kafka/tools/StreamsResetter.java#L660].
>  If assumption is wrong (either topic prefix or suffix), tool becomes useless 
> if aware even dangerous if not. Probably better either:
>  * naming assumption should be optional and supply internal topics with 
> argument (--internal-topics)
>  * deletion could be optional (--no-delete-internal)
>  * ignore topics which are included in list of --input-topics
> Faced this, when was trying to reset applications with GlobalKTable topics 
> named as *-changelog. Such topics sometimes are not desirable for deletion.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to