Skip to content
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

[cloud_storage] segment_meta_cstore::prefix_truncate fix range of _hints to remove #11119

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

andijcr
Copy link
Contributor

@andijcr andijcr commented May 31, 2023

it should point to the first hint that needs to be removed. Previously it was computed with upper_bound, but this means that it will never point to a value that's equal to frame_max_offset, meaning that that hint value could be left behind, pointing incorrectly at an offset that's no longer valid.

to find the issue, this test was extracted from cloud_storage_basic_rptest suite
https://github.com/andijcr/redpanda/blob/issue/10602/exceptional_future_ignored/src/v/cloud_storage/tests/partition_manifest_outofrange.cc
function test_partition_manifest repeatedly exercises partition_manifest::truncate, and the high randomized repetition count ensures that the exception is triggered.
this assertion https://github.com/andijcr/redpanda/blob/issue/10602/exceptional_future_ignored/src/v/cloud_storage/segment_meta_cstore.cc#L646-L648 (not included in this pr) checks that std::prev(it)->first is greater than frame_max_offset, and thus lies after the frame that will be reconstructed. it will be triggered with upper_bound but not with lower_bound

FIxes #10983

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.1.x
  • v22.3.x
  • v22.2.x

Release Notes

  • None

`it` should point to the first hint that needs to be removed. Previously is
was computed with upper_bound, but this means that it will never point
to a value that's equal to frame_max_offset, meaning that that hint
value could be left behind, pointing incorrectly at an offset that's no
longer valid
@andijcr andijcr marked this pull request as ready for review May 31, 2023 12:13
@andijcr andijcr requested review from Lazin and jcsp May 31, 2023 12:13
@andijcr andijcr changed the title segment_meta_cstore::prefix_truncate fix range of _hints to remove [cloud_storage] segment_meta_cstore::prefix_truncate fix range of _hints to remove May 31, 2023
@andijcr andijcr self-assigned this May 31, 2023
@jcsp jcsp merged commit 51151a0 into redpanda-data:dev Jun 5, 2023
@andijcr andijcr deleted the fix/segment_meta_cstore_truncation branch June 5, 2023 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI Failure (out_of_range) in cloud_storage_basic_rpunit.test_partition_manifest_outofbound_trigger
3 participants