Preethi-Sundaravelu opened a new pull request, #21826:
URL: https://github.com/apache/kafka/pull/21826

   
   kafka-streams-application-reset uses a topic name prefix match to infer
   internal topics to delete. This means that running the tool with
   --application-id my-app would silently delete internal topics belonging
   to my-app-v1 and my-app-v2 — any application whose application.id
   shares the same prefix. This is especially dangerous with typos or when
   multiple applications share a common naming convention.
   
   **Solution**
   Added a validateApplicationIdExists() method that calls listGroups()
   to verify the provided application.id exists as a consumer group before
   any topic deletion is attempted. Since Kafka Streams maps application.id
   1:1 to consumer group.id, this is a reliable and cheap check.
   
   If the group does not exist → fail fast with a clear error message
   If the group exists → proceed as normal
   If --force is provided → skip the check (existing behaviour preserved)
   
   **Changes**
   
   StreamsResetter.java — added validateApplicationIdExists() called
   inside execute() before maybeDeleteActiveConsumers()
   StreamsResetterTest.java — added 7 test cases covering the fix
   
   **Screenshot of output:**
   <img width="1668" height="385" alt="Screenshot 2026-03-19 at 12 34 08 PM" 
src="https://github.com/user-attachments/assets/9d64bb68-4797-4ab1-9d31-c07fffcad878";
 />
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to