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

Sled Agent POST /cockroachdb is not idempotent #3499

Open
davepacheco opened this issue Jul 5, 2023 · 0 comments
Open

Sled Agent POST /cockroachdb is not idempotent #3499

davepacheco opened this issue Jul 5, 2023 · 0 comments
Labels
api Related to the API. database Related to database access

Comments

@davepacheco
Copy link
Collaborator

After #2954, Sled Agent has a POST /cockroachdb API that initializes the control plane database. The current implementation is not idempotent, leading to #3498.

I also wrote:

There's another bit of this I'm a little worried about, which is exposing an API in sled agent to initialize the CockroachDB cluster. That seems a little dangerous and also overkill since we only ever intend to do this once, and only before the control plane is initialized. I considered changing this to instead have RSS pass configuration to an SMF service which would do this. The problem is that there's not a great way to propagate success/failure information back to RSS so that it can decide whether to proceed (or, I guess, burn down the world and try again). I'm going to defer fixing this for now because we really need to start playing with multi-node CockroachDB.

I think it's worth looking at the SMF option closer. This would solve a few issues:

  • it can't be called concurrently (which is good)
  • it can't be called by any component in the system at any time (which the current API can, which would almost never be valid)
  • it replaces an implicit interface between Sled Agent and the CockroachDB zone with a more explicit, well-defined one (see Sled Agent uses implicit interfaces with components it provisions #3407)

None of these affect idempotency per se, but I think this would give a better foundation for making it idempotent.

@morlandi7 morlandi7 added api Related to the API. database Related to database access labels Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the API. database Related to database access
Projects
None yet
Development

No branches or pull requests

2 participants