-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
archival: start reupload range after log start #14816
archival: start reupload range after log start #14816
Conversation
After a delete-records request, when collecting segments to determine the next upload candidate, we could end up trying to build an upload candidate with a start offset lower than the local log. Consider the following sequence: - Segment [0, 200)[200-400) are merge compacted ==> [0, 400). - Delete records ==> start offset is now 1. - Reupload our first compacted segment so we look up offset 1, realign the collection start target to a remote segment 200. - We collect segments starting from 200, getting [0, 400). - Collector gets realigned to 0 since it's the first segment. The collector now thinks it should be uploading [0, 400). - In building the upload candidate, we try to translate the range start and fail because the range start 0 is lower than the translation range start 1. This fixes this sequence to return [200, 400) as the start of the upload candidate.
ducktape was retried in job https://buildkite.com/redpanda/redpanda/builds/40649#018bac83-58ab-4a26-9181-442ce4db7576 |
The change makes sense to me but I don't quite follow the scenario listed in the PR description:
wouldn't we only get the second segment if we start collecting at 200? |
In this case, our local log only has segment [0, 400) since [0, 200)[200, 400) have been compacted, so only [0, 400) is available to be collected |
CI failure: #13787 |
/backport v23.2.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good stuffs
@@ -1039,6 +1040,87 @@ SEASTAR_THREAD_TEST_CASE(test_do_not_reupload_self_concatenated) { | |||
} | |||
} | |||
|
|||
SEASTAR_THREAD_TEST_CASE(test_do_not_reupload_prefix_truncated) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇
After a delete-records request, when collecting segments to determine the next upload candidate, we could end up trying to build an upload candidate with a start offset lower than the local log. Consider the following sequence:
This fixes this sequence to return [200, 400) as the start of the upload candidate.
Backports Required
Release Notes
Bug Fixes