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

[compute_ctl] Implement live reconfiguration #3980

Merged
merged 1 commit into from Apr 13, 2023

Conversation

ololobus
Copy link
Member

@ololobus ololobus commented Apr 7, 2023

Describe your changes

With this commit one can request compute reconfiguration from the running compute_ctl with compute in Running state by sending a new spec:

curl -d "$(cat ./compute-spec-new.json)" http://localhost:3080/spec

Internally, we start a separate configurator thread that is waiting on Condvar for ConfigurationPending compute state in a loop. Then it does reconfiguration, sets compute back to Running state and notifies other waiters.

Issue ticket number and link

Resolves neondatabase/cloud#4433

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

@ololobus ololobus requested a review from a team as a code owner April 7, 2023 11:08
@ololobus ololobus requested review from piercypixel and removed request for a team April 7, 2023 11:08
@ololobus ololobus requested a review from hlinnaka April 7, 2023 11:10
@github-actions
Copy link

github-actions bot commented Apr 7, 2023

Test results for 0912d75:


debug build: 212 tests run: 202 passed, 0 failed, 10 (full report)


release build: 212 tests run: 202 passed, 0 failed, 10 (full report)


@ololobus ololobus force-pushed the alexk/compute-reconfigure branch 2 times, most recently from 0b7b865 to 8158c3c Compare April 12, 2023 16:33
Copy link
Member Author

@ololobus ololobus left a comment

Choose a reason for hiding this comment

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

Tested this together with control-plane changes https://github.com/neondatabase/cloud/pull/4512, all public API tests passed for me locally, so I'm going to merge if no objections

It will require some follow ups like retry logic for requests to control-plane, but seems to be useful for testing in the current state

compute_tools/src/compute.rs Show resolved Hide resolved
With this commit one can request compute reconfiguration
from the running `compute_ctl` with compute in `Running` state
by sending a new spec:
```shell
curl -d "{\"spec\": $(cat ./compute-spec-new.json)}" http://localhost:3080/configure
```

Internally, we start a separate configurator thread that is waiting on
`Condvar` for `ConfigurationPending` compute state in a loop. Then it does
reconfiguration, sets compute back to `Running` state and notifies other
waiters.

It will need some follow-ups, e.g. for retry logic for control-plane
requests, but should be useful for testing in the current state. This
shouldn't affect any existing evironment, since computes are configured
in a different way there.

Resolves neondatabase/cloud#4433
@ololobus ololobus merged commit db8dd6f into main Apr 13, 2023
30 checks passed
@ololobus ololobus deleted the alexk/compute-reconfigure branch April 13, 2023 16:07
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.

None yet

4 participants