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

Push on-demand download into Timeline::get() function itself. #3305

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

hlinnaka
Copy link
Contributor

This makes Timeline::get() async, and all functions that call it directly or indirectly with it. The with_ondemand_download() mechanism is gone, Timeline::get() now always downloads files, whether you want it or not. That is what all the current callers want, so even though this loses the capability to get a page only if it's already in the pageserver, without downloading, we were not using that capability. There were some places that used 'no_ondemand_download' in the WAL ingestion code that would error out if a layer file was not found locally, but those were dubious. We do actually want to on-demand download in all of those places.

Per discussion at
#3233 (comment)

@hlinnaka hlinnaka requested review from a team as code owners January 11, 2023 12:12
@hlinnaka hlinnaka requested review from MMeent, LizardWizzard, problame and SomeoneToIgnore and removed request for a team, MMeent and LizardWizzard January 11, 2023 12:12
Copy link
Member

@koivunej koivunej left a comment

Choose a reason for hiding this comment

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

Good call on splitting this up. This seems 100% search-replace changes, but leaving approval for the better in-sync assigned.

Copy link
Contributor

@problame problame left a comment

Choose a reason for hiding this comment

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

Thanks for factoring this out!

SInce I've started this review, you've replaed apierror_from_prerror with a From impl.
I don't like it, see my comment. But I won't die on that hill.

This makes Timeline::get() async, and all functions that call it
directly or indirectly with it. The with_ondemand_download() mechanism
is gone, Timeline::get() now always downloads files, whether you want
it or not. That is what all the current callers want, so even though
this loses the capability to get a page only if it's already in the
pageserver, without downloading, we were not using that capability.
There were some places that used 'no_ondemand_download' in the WAL
ingestion code that would error out if a layer file was not found
locally, but those were dubious. We do actually want to on-demand
download in all of those places.

Per discussion at
#3233 (comment)
@hlinnaka hlinnaka merged commit c1731bc into main Jan 12, 2023
@hlinnaka hlinnaka deleted the make-get-async branch January 12, 2023 09:53
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.

4 participants