showuon opened a new pull request, #16959: URL: https://github.com/apache/kafka/pull/16959
The `COPY_SEGMENT_STARTED` state segments are counted when calculating remote retention size. This causes unexpected retention size breached segment deletion. This PR fixes it by only counting `COPY_SEGMENT_FINISHED` and `DELETE_SEGMENT_STARTED` state segments when calculating remote log size. Then, when encountering `COPY_SEGMENT_STARTED` state segments, which is not under copy process, we deleted them directly. Tests also added. ### 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