dajac commented on PR #24023:
URL: https://github.com/apache/kafka/pull/24023#issuecomment-7005569662
Thanks for the update. I think that we should focus on the real case here.
In practice, a consumer cannot change its rack without a restart, so the only
case that we care about is a static member rejoining with a different rack. In
all the other cases, the existing triggers already cover it.
The current check also has a side effect. For a new member, the rack goes
from `null` to its value, so it counts as a change. A member joining with a
rack and a regex that is not resolved yet now bumps the group epoch on join,
whereas we deliberately defer the bump until the regex is resolved.
Could we restrict the check to static members, in both places?
```java
boolean hasRackIdChanged = group.hasStaticMember(instanceId) &&
!Objects.equals(member.rackId(), updatedMember.rackId());
```
For the tests, could we:
- replace the dynamic member cases with a static member rejoining with a new
member id and a different rack, for both the consumer and the classic protocols;
- cover the cases of your table in a single parameterized test, and assert
the records rather than only the member epoch;
- set a rack id in `testConsumerGroupMemberJoinsWithNewRegex` to verify that
the group epoch is not bumped on join.
nit: Could we also update the comment above `bumpGroupEpoch` and the title
(`KAFKA-20909: Bump the consumer group epoch when a static member's rack ID
changes`)?
--
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]