Versions Compared

Key

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

Table of Contents

Status

Current state"Under Discussion"Accepted

Vote thread: here

Discussion thread: here

JIRA: KAFKA-6435 – Application Reset Tool might delete incorrect internal topics

...

Users may want to specify which internal topics should be deleted instead of deleting all internal . At present, the streams reset tool deletes all topics that start with "<app<application.id>-" . This option will allow them to do so.and there are no options to control it.

The `--internal-topics` option is especially useful when there are prefix conflicts between applications, e.g. E.g., if we have two versions of the same application named "app" and "app-v2". In this case, if we want to be able to delete reset "app", the reset tool's default behaviour will delete both the internal topics of "app" and "app-v2" (since both are prefixed by "app" without deleting -"). With the `--internal-topics` option, we can provide internal topic names for "app" and delete the internal topics of for "app-v2", but both of their " without deleting the internal topics start with for "app-v2".

Public Interfaces

Add an option to the streams reset tool.

internalTopicsOption = optionParser.accepts("
--internal-topics
", "Comma
 <String: list>      Comma-separated list of internal topics
                                      to delete. Must
If
be 
specified,
a 
these
subset 
are
of the
                                      internal
only
topics 
that
marked 
the
for 
tool will attempt to delete.")
.withRequiredArg()
.ofType(String.class)
.withValuesSeparatedBy(',')
.describedAs("list");
deletion by
                                      the default behaviour (do a dry-run without this
                                      option to view these topics).

Proposed Changes

Add an internal-topics option to streams reset tool. If specified, these will be the only topics considered for deletion. .

The `--internal-topics` option will take a comma-separated list of internal topics to be deleted. These topics must be a subset of those flagged as internal during a `--dry-run` without the `internal-topics` option. If omitted, the tool will default to the original behaviour, i.e. delete all topics that start with "<application.id>-".

Usage

Usage of the "internal-topic" options will involve:

  1. Do a Run `kafka-streams-application-reset.sh` with `--dry-run run` to check the which internal topics that will be deleted.
  2. If everything looks okay, execute without  run the script again without `--dry-runrun`. Otherwise, run it with `--internal-topics` to specify the set of internal - topics to be deleted with `--internal-topics`.

Compatibility, Deprecation, and Migration Plan

No compatibility issues. If the new option is not specified, the stream resetter's behaviour will remain unchanged.

...