-
Notifications
You must be signed in to change notification settings - Fork 473
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
pageserver: add InProgress
tenant map state, use a sync lock for the map
#5367
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
koivunej
reviewed
Sep 26, 2023
jcsp
force-pushed
the
jcsp/secondary-locations-pt2
branch
from
September 26, 2023 17:17
4c6bd2e
to
8307a31
Compare
2358 tests run: 2241 passed, 0 failed, 117 skipped (full report)Flaky tests (2)Postgres 16
Postgres 15
Code coverage (full report)
The comment gets automatically updated with the latest test results
b09891e at 2023-11-06T14:16:06.844Z :recycle: |
5 tasks
jcsp
force-pushed
the
jcsp/secondary-locations-pt2
branch
from
September 29, 2023 14:47
8307a31
to
99fd0d5
Compare
jcsp
added a commit
that referenced
this pull request
Oct 5, 2023
…ocations (#5299) ## Problem These changes are part of building seamless tenant migration, as described in the RFC: - #5029 ## Summary of changes - A new configuration type `LocationConf` supersedes `TenantConfOpt` for storing a tenant's configuration in the pageserver repo dir. It contains `TenantConfOpt`, as well as a new `mode` attribute that describes what kind of location this is (secondary, attached, attachment mode etc). It is written to a file called `config-v1` instead of `config` -- this prepares us for neatly making any other profound changes to the format of the file in future. Forward compat for existing pageserver code is achieved by writing out both old and new style files. Backward compat is achieved by checking for the old-style file if the new one isn't found. - The `TenantMap` type changes, to hold `TenantSlot` instead of just `Tenant`. The `Tenant` type continues to be used for attached tenants only. Tenants in other states (such as secondaries) are represented by a different variant of `TenantSlot`. - Where `Tenant` & `Timeline` used to hold an Arc<Mutex<TenantConfOpt>>, they now hold a reference to a AttachedTenantConf, which includes the extra information from LocationConf. This enables them to know the current attachment mode. - The attachment mode is used as an advisory input to decide whether to do compaction and GC (AttachedStale is meant to avoid doing uploads, AttachedMulti is meant to avoid doing deletions). - A new HTTP API is added at `PUT /tenants/<tenant_id>/location_config` to drive new location configuration. This provides a superset of the functionality of attach/detach/load/ignore: - Attaching a tenant is just configuring it in an attached state - Detaching a tenant is configuring it to a detached state - Loading a tenant is just the same as attaching it - Ignoring a tenant is the same as configuring it into Secondary with warm=false (i.e. retain the files on disk but do nothing else). Caveats: - AttachedMulti tenants don't do compaction in this PR, but they do in the follow on #5397 - Concurrent updates to the `location_config` API are not handled elegantly in this PR, a better mechanism is added in the follow on #5367 - Secondary mode is just a placeholder in this PR: the code to upload heatmaps and do downloads on secondary locations will be added in a later PR (but that shouldn't change any external interfaces) Closes: #5379 --------- Co-authored-by: Christian Schwarz <christian@neon.tech>
jcsp
force-pushed
the
jcsp/secondary-locations-pt2
branch
3 times, most recently
from
October 11, 2023 11:57
f995935
to
c0f5248
Compare
jcsp
force-pushed
the
jcsp/secondary-locations-pt2
branch
from
October 19, 2023 15:49
c0f5248
to
071e06b
Compare
jcsp
force-pushed
the
jcsp/secondary-locations-pt2
branch
3 times, most recently
from
October 31, 2023 09:46
a2dbce5
to
d908b55
Compare
jcsp
force-pushed
the
jcsp/secondary-locations-pt2
branch
from
October 31, 2023 14:49
d908b55
to
4f29dfb
Compare
5 tasks
jcsp
force-pushed
the
jcsp/secondary-locations-pt2
branch
from
November 1, 2023 14:23
4f29dfb
to
a2e7a79
Compare
jcsp
force-pushed
the
jcsp/secondary-locations-pt2
branch
from
November 2, 2023 11:31
a2e7a79
to
19467ad
Compare
jcsp
added
t/feature
Issue type: feature, for new features or requests
c/storage/pageserver
Component: storage: pageserver
labels
Nov 2, 2023
shanyp
approved these changes
Nov 6, 2023
arpad-m
reviewed
Nov 6, 2023
arpad-m
requested changes
Nov 6, 2023
arpad-m
approved these changes
Nov 6, 2023
This was referenced Nov 6, 2023
Test failure looks like a test helper issue: |
koivunej
reviewed
Nov 6, 2023
Comment on lines
+1433
to
+1435
unsafe impl Send for SlotGuard {} | ||
unsafe impl Sync for SlotGuard {} | ||
|
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.
No one questioned this?
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.
thanks for pointing this out, cross linking #5802 which addresses this.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
c/storage/pageserver
Component: storage: pageserver
t/feature
Issue type: feature, for new features or requests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Follows on from #5299
Tenant
had states, but for our arbitrary transitions between secondary/attached, we need a general way to say "reserve this tenant ID, and don't allow any other ops on it, but don't try and report it as being in any particular state".Summary of changes
TenantSlot::InProgress
value. This means:std::sync::RwLock
get_active_tenant_with_timeout
for page_service to use, which will wait on InProgress slots as well as non-active tenants.Closes: #5378