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

pageserver: fix return code from secondary_download_handler #8508

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

jcsp
Copy link
Contributor

@jcsp jcsp commented Jul 25, 2024

Problem

The secondary download HTTP API is meant to return 200 if the download is complete, and 202 if it is still in progress. In #8198 the download implementation was changed to drop out with success early if it over-runs a time budget, which resulted in 200 responses for incomplete downloads.

This breaks storcon_cli's "tenant-warmup" command, which uses the OK status to indicate download complete.

Summary of changes

  • Only return 200 if we get an Ok() and the progress stats indicate the download is complete.

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

@jcsp jcsp added t/bug Issue Type: Bug c/storage/pageserver Component: storage: pageserver labels Jul 25, 2024
@jcsp jcsp changed the title pageserver: fix return code form secondary_download_handler pageserver: fix return code from secondary_download_handler Jul 25, 2024
@jcsp jcsp marked this pull request as ready for review July 25, 2024 08:20
@jcsp jcsp requested a review from a team as a code owner July 25, 2024 08:20
@jcsp jcsp requested a review from skyzh July 25, 2024 08:20
Copy link

3126 tests run: 3005 passed, 0 failed, 121 skipped (full report)


Flaky tests (4)

Postgres 14

  • test_partial_evict_tenant[relative_equal]: release
  • test_partial_evict_tenant[relative_spare]: release
  • test_scrubber_physical_gc_ancestors[2]: debug
  • test_pull_timeline[True]: debug

Code coverage* (full report)

  • functions: 32.7% (6998 of 21407 functions)
  • lines: 50.1% (55637 of 111007 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
b4ebc76 at 2024-07-25T08:42:23.551Z :recycle:

Copy link
Member

@skyzh skyzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, so the 2XX status code could be a failed attempt :rolling_on_the_floor_laughing:

@jcsp jcsp merged commit 5775662 into main Jul 29, 2024
69 checks passed
@jcsp jcsp deleted the jcsp/secondary-download-status branch July 29, 2024 14:05
arpad-m pushed a commit that referenced this pull request Aug 5, 2024
## Problem

The secondary download HTTP API is meant to return 200 if the download
is complete, and 202 if it is still in progress. In #8198 the download
implementation was changed to drop out with success early if it
over-runs a time budget, which resulted in 200 responses for incomplete
downloads.

This breaks storcon_cli's "tenant-warmup" command, which uses the OK
status to indicate download complete.

## Summary of changes

- Only return 200 if we get an Ok() _and_ the progress stats indicate
the download is complete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/storage/pageserver Component: storage: pageserver t/bug Issue Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants