dajac opened a new pull request, #24146: URL: https://github.com/apache/kafka/pull/24146
After `SnapshotRegistry.revertToSnapshot`, iterating a `TimelineHashMap` or a `TimelineHashSet` at the reverted snapshot, or at an older one, returns the elements that the revert restored twice, and can skip an element once one of them is overwritten or removed again. The group coordinator reverts a failed write and reads at the last committed offset, so until the next write is committed, ConsumerGroupDescribe, ShareGroupDescribe, StreamsGroupDescribe, OffsetFetch for all the partitions of a group and ListGroups can return a member, a partition or a group twice, or miss one. The revert puts the elements back into the current table but also keeps them in the tier of the snapshot, which the iteration reads as well. A related issue affects `SnapshotRegistry.deleteSnapshot(long)`, which no production code calls: `HashTier.mergeFrom` never clears the list of the slot it unpacks, so the merged tier can grow larger than the current table, and the iterator then skips elements. This patch drops the elements of the tier once the revert has put them back in the current table, and clears the list after each slot in `mergeFrom`. It adds tests for both cases and a randomized test that checks iteration, lookups and sizes at every snapshot against a model. -- 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]
