Commit 82241e1
authored
KAFKA-19891: Bump group epoch when member regex subscription transitions from non-empty to empty (#21013)
This PR fixes an issue in
GroupMetadataManager#maybeUpdateRegularExpressions where a member’s
regex subscription transition from non-empty → empty did not trigger a
group epoch bump. The method previously returned REGEX_UPDATED, which
does not cause consumerGroupHeartbeat to increment the group epoch.
Fix The patch updates the logic to return: REGEX_UPDATED_AND_RESOLVED
when:
the updated regex subscription text is empty, and the previous
subscription was non-empty. This ensures that consumerGroupHeartbeat
correctly bumps the group epoch, keeping the group metadata consistent.
Tests
Several tests were updated to align with the corrected behavior. Tests
that previously expected no epoch bump were failing, and have now been
adjusted to expect the new, correct logic.
JIRA https://issues.apache.org/jira/browse/KAFKA-19891
Impact
Fixes coordinator state correctness for regex-subscribing consumer
groups Ensures group epoch bumps happen for all relevant subscription
transitions Backward compatible No public API changes
Reviewers: Sean Quah <[email protected]>, David Jacot <[email protected]>1 parent 10ebba5 commit 82241e1
File tree
2 files changed
+83
-0
lines changed- group-coordinator/src
- main/java/org/apache/kafka/coordinator/group
- test/java/org/apache/kafka/coordinator/group
2 files changed
+83
-0
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3313 | 3313 | | |
3314 | 3314 | | |
3315 | 3315 | | |
| 3316 | + | |
| 3317 | + | |
3316 | 3318 | | |
3317 | 3319 | | |
3318 | 3320 | | |
| |||
Lines changed: 81 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21542 | 21542 | | |
21543 | 21543 | | |
21544 | 21544 | | |
| 21545 | + | |
| 21546 | + | |
| 21547 | + | |
| 21548 | + | |
| 21549 | + | |
| 21550 | + | |
| 21551 | + | |
| 21552 | + | |
| 21553 | + | |
| 21554 | + | |
| 21555 | + | |
| 21556 | + | |
| 21557 | + | |
| 21558 | + | |
| 21559 | + | |
| 21560 | + | |
| 21561 | + | |
| 21562 | + | |
| 21563 | + | |
| 21564 | + | |
| 21565 | + | |
| 21566 | + | |
| 21567 | + | |
| 21568 | + | |
| 21569 | + | |
| 21570 | + | |
| 21571 | + | |
| 21572 | + | |
| 21573 | + | |
| 21574 | + | |
| 21575 | + | |
| 21576 | + | |
| 21577 | + | |
| 21578 | + | |
| 21579 | + | |
| 21580 | + | |
| 21581 | + | |
| 21582 | + | |
| 21583 | + | |
| 21584 | + | |
| 21585 | + | |
| 21586 | + | |
| 21587 | + | |
| 21588 | + | |
| 21589 | + | |
| 21590 | + | |
| 21591 | + | |
| 21592 | + | |
| 21593 | + | |
| 21594 | + | |
| 21595 | + | |
| 21596 | + | |
| 21597 | + | |
| 21598 | + | |
| 21599 | + | |
| 21600 | + | |
| 21601 | + | |
| 21602 | + | |
| 21603 | + | |
| 21604 | + | |
| 21605 | + | |
| 21606 | + | |
| 21607 | + | |
| 21608 | + | |
| 21609 | + | |
| 21610 | + | |
| 21611 | + | |
| 21612 | + | |
| 21613 | + | |
| 21614 | + | |
| 21615 | + | |
| 21616 | + | |
| 21617 | + | |
| 21618 | + | |
| 21619 | + | |
| 21620 | + | |
| 21621 | + | |
| 21622 | + | |
| 21623 | + | |
| 21624 | + | |
| 21625 | + | |
21545 | 21626 | | |
21546 | 21627 | | |
21547 | 21628 | | |
| |||
0 commit comments