Radiancebobo opened a new pull request, #24235: URL: https://github.com/apache/kafka/pull/24235
[KAFKA-21516](https://issues.apache.org/jira/browse/KAFKA-21516) A delayed `InitializeShareGroupState` retry can overwrite persisted consumption progress after a share partition has started consuming. The duplicate check currently compares both `stateEpoch` and `startOffset`, but normal consumption advances the offset without changing the epoch. The retry then writes a fresh initialization snapshot, resetting the offset and clearing persisted acknowledgements and delivery completion count. Treat initialization as a no-op whenever state already exists at the requested epoch, regardless of the requested offset. Higher-epoch requests continue to reset state, and lower-epoch requests remain fenced. Current trunk advances the group epoch before administrative offset resets, as implemented in [KAFKA-20910](https://issues.apache.org/jira/browse/KAFKA-20910). Add a regression test that initializes a partition, persists consumption progress and acknowledgements, retries the original initialization, and verifies that the persisted state is preserved. Additional coverage verifies same-epoch retries with different offsets and higher-epoch resets to lower, equal, and higher offsets. Compatibility: older Group Coordinators, including 4.1.0, can issue legitimate administrative resets without advancing the epoch. An upgraded Share Coordinator will treat these requests as no-ops and return success without applying the reset. During a mixed-version upgrade, avoid these resets until all brokers that can host the Group Coordinator have been upgraded to a version containing the epoch-bumping reset logic. Any ignored reset must be reissued afterward. -- 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]
