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

[v24.1.x] [CORE-2581] cst: move chunk downloads to remote segment bg loop #18269

Merged

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #18093

Remote segment background loop now downloads all enqueued chunks. This
download was previous done by chunk API from any fiber. The downloads
are only performed at the end of a loop iteration, provided that the
index is materialized and we are not operating in legacy mode, where
full segments are downloaded.

The chunk download requests are kept in a fragmented vector. Only one
download is expected per chunk start offset. The first request for a
chunk is added to the vector, the chunk API is expected to enqueue the
subsequent callers into a waiter list. Since chunk consumers use a
shared ptr to access the chunk file handle, and the file handle is
evicted when there are no consumers attached to it, we maintain a
single entry for a chunk download request within remote to ensure that
we do not return multiple ss::file objects for the same chunk file.

(cherry picked from commit e2dd582)
The chunk API now uses the download_chunk method, and removes unused
code. The downloads are now enqueued in the remote segment bg-loop.

(cherry picked from commit cc1d48c)
The ducktape test for chunk read now deletes chunk files randomly while
the random and seq consumer are running. This increases the chances of
the chunk materialization failing and hitting the code path where chunk
has to be rehydrated again.

(cherry picked from commit 305118d)
@vbotbuildovich vbotbuildovich added this to the v24.1.x-next milestone May 6, 2024
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label May 6, 2024
@abhijat abhijat merged commit 9d6bb31 into redpanda-data:v24.1.x May 6, 2024
19 checks passed
@piyushredpanda piyushredpanda modified the milestones: v24.1.x-next, v24.1.3 May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants