-
Notifications
You must be signed in to change notification settings - Fork 496
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
compute_ctl: Perform more startup actions in parallel #11008
base: heikki/refactor-compute_ctl-2
Are you sure you want to change the base?
compute_ctl: Perform more startup actions in parallel #11008
Conversation
Note: This is part of a 3-part series of PRs: |
7744 tests run: 7364 passed, 0 failed, 380 skipped (full report)Flaky tests (2)Postgres 17
Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
e54eda2 at 2025-02-28T13:57:09.036Z :recycle: |
2f8b394
to
dae4c2a
Compare
ea66b21
to
abd86d1
Compare
dae4c2a
to
7bc981e
Compare
3a6fefc
to
6244f72
Compare
6244f72
to
2a0918e
Compare
compute_tools/src/compute.rs
Outdated
// If there are any remote extensions in shared_preload_libraries, start downloading them | ||
if pspec.spec.remote_extensions.is_some() { | ||
let (this, spec) = (self.clone(), pspec.spec.clone()); | ||
pre_tasks.spawn_blocking_child(move || this.download_preload_extensions(&spec)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With async closures (async || {}
) I think this should not need the clone()
operations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't get that to work
let (this, cs) = (self.clone(), compute_state.clone()); | ||
pre_tasks.spawn_blocking_child(move || this.prepare_pgdata(&cs)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
2a0918e
to
32f2bc7
Compare
14de70f
to
33a2459
Compare
To speed up compute startup. Resizing swap in particular takes about 100 ms on my laptop. By performing it in parallel with downloading the basebackup, that latency is effectively hidden. I would imagine that downloading remote extensions can also take a non-trivial amount of time, although I didn't try to measure that. In any case that's now also performed in parallel with downloading the basebackup.
22d1fb2
to
dd4c55d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, that was the next step I had in mind too :)
@@ -669,20 +679,6 @@ impl ComputeNode { | |||
let config_time = Utc::now(); | |||
if pspec.spec.mode == ComputeMode::Primary { | |||
self.configure_as_primary(&compute_state)?; | |||
let conf = self.get_conn_conf(None); | |||
tokio::task::spawn_blocking(|| { | |||
let res = get_installed_extensions(conf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, looks like this part got removed completely, but we need this for the extensions' metrics
To speed up compute startup. Resizing swap in particular takes about 100 ms on my laptop. By performing it in parallel with downloading the basebackup, that latency is effectively hidden. I would imagine that downloading remote extensions can also take a non-trivial amount of time, although I didn't try to measure that. In any case that's now also performed in parallel with downloading the basebackup.