kevin-wu24 opened a new pull request, #17500: URL: https://github.com/apache/kafka/pull/17500
When `KafkaRaftClient` receives a request to create a snapshot with offset that is not aligned to a batch boundary, do not create a misaligned snapshot and instead log an error. * Add `batchAlignedOffsets` set to `KafkaRaftClient` to track the batch aligned offsets appended to the log by KRaft replica. * Remove unnecessary offsets from `batchAlignedOffsets` when either: replica applies a snapshot from the leader or replica successfully writes and freezes its own local snapshot. In both cases, offsets <= snapshotId.offset() can be removed from the set since the offsets are not in the log anymore. Testing * Modified unit tests in `KafkaRaftClientSnapshotTest`. ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org