You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/11/19 07:00:23 UTC

[GitHub] [kafka] showuon commented on pull request #11451: KAFKA-13419: Only reset generation ID when ILLEGAL_GENERATION error

showuon commented on pull request #11451:
URL: https://github.com/apache/kafka/pull/11451#issuecomment-973803318


   @dajac , thanks for your comments. Yes, you are right, I didn't make the if condition correct. I've updated it to use a `hasGenerationReset` helper method:
   ```java
   private boolean hasGenerationReset(Generation gen) {
           // the member ID might not be reset for ILLEGAL_GENERATION error, so only check generationID and protocol name here
           return gen.generationId != Generation.NO_GENERATION.generationId && gen.protocolName == null;
       }
   ```
   Before this change, we can just do `if (generation.equals(NO_GENERATION))`, to check if the generation object is reset or not, now, the check should check for `generationID` and `protocolName` field only, because member Id might not be reset for some cases.
   
   Thank you.


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org