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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]