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

fix(pageserver): drain upload queue before offloading timeline #9682

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

skyzh
Copy link
Member

@skyzh skyzh commented Nov 7, 2024

Problem

It is possible (is it?) at the point we shutdown the timeline, there are still layer files we did not upload.

Summary of changes

  • If the queue is not empty, avoid offloading.
    • Hmm... is it correct? We don't explicitly wait for files to be uploaded in the compaction code, and we offload the timeline right after compaction, which means that it will always fail if a compaction gets scheduled and triggers timeline offload?
  • Otherwise, shutdown the timeline gracefully using the flush mode to ensure all local files are uploaded before deleting the timeline directory.

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

  • Do not forget to reformat commit message to not include the above checklist

@skyzh skyzh requested a review from arpad-m November 7, 2024 16:59
Copy link

github-actions bot commented Nov 7, 2024

5328 tests run: 5106 passed, 0 failed, 222 skipped (full report)


Code coverage* (full report)

  • functions: 31.6% (7801 of 24714 functions)
  • lines: 49.0% (61173 of 124811 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
bc85b03 at 2024-11-07T20:15:51.064Z :recycle:

pageserver/src/tenant/timeline/offload.rs Outdated Show resolved Hide resolved
pageserver/src/tenant/timeline/offload.rs Outdated Show resolved Hide resolved
@skyzh skyzh marked this pull request as ready for review November 7, 2024 19:23
@skyzh skyzh requested a review from a team as a code owner November 7, 2024 19:23
@skyzh skyzh requested review from erikgrinaker and removed request for a team November 7, 2024 19:23
Base automatically changed from skyzh/drain-queue-ancestor-detach to main November 8, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants