-
Notifications
You must be signed in to change notification settings - Fork 486
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
Move compute_ctl structs used in HTTP API and spec file to separate crate. #3937
Conversation
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.
Moving structures in a separate crate sounds as good first step. Also moving metrics under the same lock should be fine too, as actually they are set now only during initial startup, so it's basically the same writer all the time
Yet, I made state to be under Mutex
in the #3923 because of two reasons:
- Condvar was super convenient for my use case
- Write lock in the
RwLock
anyway blocks all readers, IIUC. And we don't have a case when there are a lot of concurrent readers
What do you think?
We should also agree on the order of PRs, probably :) Yours seems to be important to write better tests in the neon
repo. Mine is needed to unblock control-plane work on reconfiguration without restart and maintaining the pool of pre-created computes. So not sure, just your refactoring looks relatively huge in general (if we consider all needed PRs)
b410af5
to
8e06018
Compare
Test results for f0b2e07:debug build: 212 tests run: 202 passed, 0 failed, 10 (full report)release build: 212 tests run: 202 passed, 0 failed, 10 (full report) |
Sure, Mutex is fine.
First to push wins ;-). I suggest:
I can rebase #3923 over those two, I think the conflicts are pretty mechanical |
8e06018
to
939ea29
Compare
Rebased, fixing conflicts with commit e42982f. I think this is ready to be merged. Please review and approve if you agree. |
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, one comment / suggestion about files layout and this text
One non-mechanical change here is that we now use a RwLock rather than atomics to protect the ComputeNode::metrics field. We were not using atomics for performance but for convenience here, and an RwLock is now more convenient.
should be updated as we use Mutex now.
939ea29
to
1f2df18
Compare
…rate. This is in preparation of using compute_ctl to launch postgres nodes in the neon_local control plane. And seems like a good idea to separate the public interfaces anyway. One non-mechanical change here is that the 'metrics' field is moved under the Mutex, instead of using atomics. We were not using atomics for performance but for convenience here, and it seems more clear to not use atomics in the model for the HTTP response type.
1f2df18
to
f0b2e07
Compare
This is in preparation of using compute_ctl to launch postgres nodes in the neon_local control plane. And seems like a good idea to separate the public interfaces anyway.
One non-mechanical change here is that we now use a RwLock rather than atomics to protect the ComputeNode::metrics field. We were not using atomics for performance but for convenience here, and an RwLock is now more convenient.
(extracted to separate PR from PR #3886)