-
Notifications
You must be signed in to change notification settings - Fork 416
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
control_plane/attachment_service: complete APIs #6394
Conversation
de91592
to
ba13b2c
Compare
2364 tests run: 2272 passed, 0 failed, 92 skipped (full report)Flaky tests (2)Postgres 16
Postgres 15
Code coverage (full report)
The comment gets automatically updated with the latest test results
c666841 at 2024-01-30T18:42:52.175Z :recycle: |
ba13b2c
to
2d0203c
Compare
303e61f
to
61a3222
Compare
Mostly just for my curiosity, did you by any chance consider using sqlite? It seems like an in-process database could save some complexity. |
Yes -- postgres is used because that's what we'll use in production: I don't want to test against a different database than we run with. It also simplifies life to avoid dealing with two SQL dialects. The impact to test runtime from adding a postgres process is very small, but if we want to eliminate it I'd do it by just adding a non-persistent mode to the attachment service (i.e. use no database at all), since in most tests it is never restarted. |
attachment_service
12ba0aa
to
be76406
Compare
be76406
to
6a6e97e
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.
I like the new distinction between upcall & control plane calls.
Regarding tenant_location_config
: would prefer if, isntead of special-casing creation later, it would detect the need to create first, do it if necessary, then enter common code path of update. Rationale: it de-special-cases the creation to some extend. Doesn't have to be this PR though.
Also regarding tenant_location_config
: I didn't keep up with all the changes, but, is this the first API that allows configuring a (single-)sharded tenant?
I think I need to spend more time with service.rs
, but, wanted to flush my pending review comments by this time.
If you mean on the pageserver API: Yes, although it has allowed it for some time already: because tenant creation is really just an attach, one can create a multi-sharded tenant by issuing a series of /location_config calls to shards. If you mean in the attachment service API: no, one could already do it with the tenant creation API. |
This code is refactored in #6521 -- the create and update paths are still separate, but in a more obvious way that avoids having to read back and forth in the function. |
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.
Wrote a lengthy comment on the location config API.
I think the idea of the "virtual pageserver" API is a good approach to offload work off the control plane team, but, the fact that we're sometimes transferring authority over generation numbers bears a too-high-risk is too risky for my taste, as pointed out in the comment.
Proposal: continue with virtual pageserver API approach, but, don't move authority over generation numbers. Instead, have this service call to the generation numbers service, just like the control plane code does.
None of these concerns are directly related to this specific PR, which I'll approve to unblock you.
But, I'm medium-to-strongly opposed to putting it into production until we have found a way to de-risk the generation numbers authority thing.
Cleanups from #6394 - There was a rogue `*` breaking the `GET /tenant/:tenant_id`, which passes through to shard zero - There was a duplicate migrate endpoint - There are un-prefixed API endpoints that were only needed for compat tests and can now be removed.
Depends on: #6468
Problem
The sharding service will be used as a "virtual pageserver" by the control plane -- so it needs the set of pageserver APIs that the control plane uses, and to present them under identical URLs, including prefix (/v1).
Summary of changes
/location_config
API (for migrating tenants into the sharding service)/v1
prefix is used for pageserver-compatible APIs/upcall/v1
prefix is used for APIs that are called by the pageserver (re-attach and validate)/debug/v1
prefix is used for endpoints that are for testing/control/v1
prefix is used for new sharding service APIs that do not mimic a pageserver API, such as registering and configuring nodes.Checklist before requesting a review
Checklist before merging