kafka/share-coordinator/src
Sushant Mahajan ff5025a21c
KAFKA-19695: Fix bug in redundant offset calculation. (#20516)
* The `ShareCoordinatorShard` maintains the the record offset
information for `SharePartitionKey`s in the
`ShareCoordinatorOffsetsManager` class.
* Replay of `ShareSnapshot`s in the shards are reflected in the offsets
manager including records created due to delete state.
* However, if the share partition delete is due to topic delete, no
record will ever be written for the same  `SharePartitionKey` post the
delete tombstone (as topic id will not repeat).
As a result the offset manager will always consider the deleted share
partition's offset as the last redundant one.
* The fix is to make the offset manager aware of the tombstone records
and remove them from the redundant offset calculation.
* Unit tests have been updated for the same.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal
 <apoorvmittal10@gmail.com>
2025-09-10 11:38:34 -05:00
..
main KAFKA-19695: Fix bug in redundant offset calculation. (#20516) 2025-09-10 11:38:34 -05:00
test/java/org/apache/kafka/coordinator/share KAFKA-19695: Fix bug in redundant offset calculation. (#20516) 2025-09-10 11:38:34 -05:00