-
Notifications
You must be signed in to change notification settings - Fork 40
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
[nexus] add sled provision state #4520
[nexus] add sled provision state #4520
Conversation
Created using spr 1.3.5
Created using spr 1.3.5
Created using spr 1.3.5
Created using spr 1.3.5
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.
Looks great! I have a smattering of comments, but my big two are:
- We gotta do a minor rename to make the schema change work
- The transactional semantics of altering the
provisionable
state need some tweaking to make the return value consistent -- but I have a small essay discussing some of our options there
Created using spr 1.3.5
Created using spr 1.3.5
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.
Looks good to me -- thanks for the fixes!
Created using spr 1.3.5
Created using spr 1.3.5
Created using spr 1.3.5
"description": "This is a state that isn't known yet.\n\nThis is defined to avoid API breakage.", | ||
"type": "string", | ||
"enum": [ | ||
"unknown" | ||
] | ||
} |
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.
Is this how you intended this state to appear in the OpenAPI doc? I'm not clear on how this will prevent API breakage.
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.
Addressed in #4608
…4573) While developing #4520, I observed that we were producing a number of error messages that were: * 503 Service Unavailable, * With only an internal message attached * But where the message is both safe and useful to display to clients. This is my attempt to make the situation slightly better. To achieve this, I made a few changes: 1. Make all the client errors carry a new `MessagePair` struct, which consists of an external message. (Along the way, correct the definition of e.g. the `Conflict` variant: it actually is an external message, not an internal one.) 2. Define a new `InsufficientCapacity` variant that consists of both an external and an internal message. This variant resolves to a 507 Insufficient Storage error, and has a more helpful message than just "Service Unavailable". 3. Turn some current 503 errors into client errors so that the message is available externally. Looking for feedback on this approach!
Add the notion of a sled provision state to Nexus. Currently, we will only use this to prevent new resources and regions from being provisioned to sleds.
This PR includes:
nexus-db-queries
.Questions:
TODO list
TODO:
db::model::Sled
should track provision state -- it seems like it is created by sled_agent API calls, which don't know the provision state. Butsled_list
should return the provision state. Do we need to split up the type into two, one for creation and one for listing? Are there existing patterns for this?db::model::Sled
has alast_used_address
parameter that is assigned here but not used insled_upsert
. This seems maybe a bit dodgy?Fixes (maybe partially) #2483.