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

storcon: tenant_remote_mutation followups #8819

Closed
jcsp opened this issue Aug 23, 2024 · 0 comments · Fixed by #8875
Closed

storcon: tenant_remote_mutation followups #8819

jcsp opened this issue Aug 23, 2024 · 0 comments · Fixed by #8875
Assignees

Comments

@jcsp
Copy link
Collaborator

jcsp commented Aug 23, 2024

via #8783

  1. The ensure_attached_wait call:
  • If the tenant is really Detached, we can 409 out immediately
  • If it's meant to be attached but hasn't got an attached_pageserver yet, we can 503 and let the caller retry
  • So do we even need this? It's hard to reason about vs. deadlocks because it can block indefinitely.
  1. The check for i.1 not being None is not very readable, we should make it clearer whether we're saying "must have generation pageserver" or "must have generation".
@jcsp jcsp self-assigned this Aug 23, 2024
@jcsp jcsp closed this as completed in #8875 Sep 2, 2024
jcsp added a commit that referenced this issue Sep 2, 2024
## Problem

This is a followup to #8783

- The old blocking ensure_attached function had been retained to handle
the case where a shard had a None generation_pageserver, but this wasn't
really necessary.
- There was a subtle `.1` in the code where a struct would have been
clearer

Closes #8819

## Summary of changes

- Add ShardGenerationState to represent the results of peek_generation
- Instead of calling ensure_attached when a tenant has a non-attached
shard, check the shard's policy and return 409 if it isn't Attached,
else return 503 if the shard's policy is attached but it hasn't been
reconciled yet (i.e. has a None generation_pageserver)
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 a pull request may close this issue.

1 participant