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: skip over segments below archive start #16645

Merged
merged 3 commits into from
Feb 21, 2024

Conversation

andrwng
Copy link
Contributor

@andrwng andrwng commented Feb 20, 2024

This fixes a bug for timequeries that could result in a removed segment being
unsuccessfully downloaded during a timequery. The sequence of events is as
follows:

1. Spillover manifest [7278, 8592]
2. Spillover more manifests... [...13574]
3. Eventually our stm manifest is [13875, 15802]
4. We housekeep and truncate to 7804. This is the new archive start offset and
   archive clean offset
5. A timequery comes in whose timestamp falls in manifest [7278, 8592]
6. Segment [7278-7410] is attempted to be downloaded, which has already been
   removed

To fix this, as we're seeking within a given manifest, we'll now check against
the overall start offset of the partition, skipping any segments that fall
below the start.

Fixes #15042

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.3.x
  • v23.2.x
  • v23.1.x

Release Notes

Bug fix

  • Fixes a bug in the tiered storage time-based query implementation that could result in a consumer hang when consuming very old data.

@andrwng andrwng marked this pull request as draft February 20, 2024 17:10
@andrwng
Copy link
Contributor Author

andrwng commented Feb 20, 2024

Marking as draft while I sort out a test failure

I have an upcoming test that depends on segments actually being deleted
in S3. The current s3_imposter implementation only removes objects if
using the singular object deletion API.

This commit fills in the implementation for batch deletion to actually
remove the batch-deleted files from the list maintained by s3_imposter.
An upcoming change will examine the full log's start offset to determine
whether or not to skip over a given segment.

To that end, this introduces a method similar to
`full_log_start_kafka_offset` that instead returns the model::offset
corresponding to the log's start offset.
@andrwng
Copy link
Contributor Author

andrwng commented Feb 20, 2024

/ci-repeat

This fixes a bug for timequeries that could result in a removed segment being
unsuccessfully downloaded during a timequery. The sequence of events is as
follows:

1. Spillover manifest [7278, 8592]
2. Spillover more manifests... [...13574]
3. Eventually our stm manifest is [13875, 15802]
4. We housekeep and truncate to 7804. This is the new archive start offset and
   archive clean offset
5. A timequery comes in whose timestamp falls in manifest [7278, 8592]
6. Segment [7278-7410] is attempted to be downloaded, which has already been
   removed

To fix this, as we're seeking within a given manifest, we'll now check against
the overall start offset of the partition, skipping any segments that fall
below the start.

Fixes redpanda-data#15042
@andrwng
Copy link
Contributor Author

andrwng commented Feb 21, 2024

/ci-repeat

@andrwng andrwng marked this pull request as ready for review February 21, 2024 07:18
@andrwng andrwng merged commit 4f7ba7c into redpanda-data:dev Feb 21, 2024
16 checks passed
@vbotbuildovich
Copy link
Collaborator

/backport v23.3.x

@vbotbuildovich
Copy link
Collaborator

/backport v23.2.x

@vbotbuildovich
Copy link
Collaborator

Failed to create a backport PR to v23.2.x branch. I tried:

git remote add upstream https://github.com/redpanda-data/redpanda.git
git fetch --all
git checkout -b backport-pr-16645-v23.2.x-58 remotes/upstream/v23.2.x
git cherry-pick -x 23b09d89831f9ee3d3ab8bc5fb9f3b6f0d8c7bfb bf14de73bba63ae592c62fa8f6c13f7be761a53f d05608001bd77c5b3a60c96946c3c88608cfb514

Workflow run logs.

@piyushredpanda
Copy link
Contributor

Thanks for the fix, @andrwng !

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 (consumer timed out) in CloudStorageTimingStressTest.test_cloud_storage
5 participants