muralibasani opened a new pull request, #24193:
URL: https://github.com/apache/kafka/pull/24193

   If a streams application stops without leaving the group (crash / `kill -9`) 
and its source topic is then deleted, the dead members keep their assignment 
until `group.streams.session.timeout.ms` expires.
   
   During that window `kafka-streams-groups.sh --describe` failed with:
   
   `UnknownTopicOrPartitionException: Failed to fetch metadata for partition 
streams-plaintext-input-1 because metadata for topic `streams-plaintext-input` 
could not be found`
   
   Fix :  `getOffsets` reads each partition's `listOffsets` result. Partitions 
whose topic no longer exists (`UnknownTopicOrPartitionException`) are left out;
   
   **Tested locally :** 
   
   single-node KRaft, WordCountDemo with `group.protocol=streams`, `kill -9`, 
delete `streams-plaintext-input`, then `kafka-streams-groups.sh --describe 
--all-groups` while the dead member still holds `ACTIVE: 0:[0,1,2]; 1:[0,1,2]`.
   
   Before:
   
   `Error: Executing streams group command failed due to 
org.apache.kafka.common.errors.UnknownTopicOrPartitionException: Failed to 
fetch metadata for partition streams-plaintext-input-2 because metadata for 
topic `streams-plaintext-input` could not be found at 
...StreamsGroupCommand$StreamsGroupService.getOffsets(StreamsGroupCommand.java:476)
 exit=1
   `
   
   After:
   
   ```
   GROUP             TOPIC                                                      
            PARTITION  OFFSET-LAG
   streams-wordcount streams-plaintext-input                                    
            2          -
   streams-wordcount streams-plaintext-input                                    
            0          -
   streams-wordcount streams-plaintext-input                                    
            1          -
   streams-wordcount 
streams-wordcount-KSTREAM-AGGREGATE-STATE-STORE-0000000003-repartition 0        
  2
   streams-wordcount 
streams-wordcount-KSTREAM-AGGREGATE-STATE-STORE-0000000003-repartition 1        
  3
   streams-wordcount 
streams-wordcount-KSTREAM-AGGREGATE-STATE-STORE-0000000003-repartition 2        
  4
   exit=0
   ```


-- 
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