kafka/group-coordinator
David Jacot 31f79055ce
KAFKA-17306; Soften the validation when replaying tombstones (#16898)
This patch fixes a few buts in the replay logic of the consumer group records:
* The first issue is that the logic assumed that the group or the member exists when tombstones are replayed. Obviously, this is incorrect after a restart. The group or the member may not me there anymore if the __consumer_offsets partitions only contains tombstones for the group or the member. The patch fixes this by considering tombstones as no-ops if the entity does not exist.
* The second issue is that the logic assumed that consumer group records are always in a specific order in the log so the logic was only accepting to create a consumer group when `ConsumerGroupMemberMetadata` record is replayed. This is obviously incorrect too. During the life time of a consumer group, the records may be in different order. The patch fixes this by allowing the creating of a consumer group by any record.
* The third issue is that it is possible to replay offset commit records for a specific consumer group before the consumer group is actually created while replying its records. By default the OffsetMetadataManager creates a simple classic group to hold those offset commits. When the consumer offset records are finally replayed, the logic will fail because a classic group already exists. The patch fixes this by converting a simple classic group when records for a consumer group are replayed.

All those combinations are hard to test with unit tests. This patch adds an integration tests which reproduces some of those interleaving of records. I used them to reproduce the issues describe above.

Reviewers: TengYao Chi <kitingiao@gmail.com>, Jeff Kim <jeff.kim@confluent.io>, Justine Olshan <jolshan@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-09-10 07:28:36 -07:00
..
group-coordinator-api/src/main/java/org/apache/kafka/coordinator/group/api/assignor KAFKA-16944; Rewrite Range Assignor (#16504) 2024-07-04 10:33:09 -07:00
src KAFKA-17306; Soften the validation when replaying tombstones (#16898) 2024-09-10 07:28:36 -07:00
.gitignore KAFKA-14363; Add new `group-coordinator` module (KIP-848) (#12827) 2022-11-09 08:49:57 +01:00