Skip to content

Commit

Permalink
Clarify how initial runtime states work
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcolombo committed Apr 12, 2023
1 parent 46e7d37 commit cefcf42
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nexus/src/app/instance.rs
Expand Up @@ -356,11 +356,14 @@ impl super::Nexus {
// target sled agent will populate its instance manager with the
// contents of this modified record, and that record needs to allow a
// transition to the Starting state.
let new_runtime = nexus_db_model::InstanceRuntimeState {
//
// If the instance does exist on this sled, this initial runtime state
// is ignored.
let initial_runtime = nexus_db_model::InstanceRuntimeState {
state: nexus_db_model::InstanceState(InstanceState::Creating),
..db_instance.runtime_state
};
db_instance.runtime_state = new_runtime;
db_instance.runtime_state = initial_runtime;
self.instance_ensure_registered(opctx, &authz_instance, &db_instance)
.await?;

Expand Down

0 comments on commit cefcf42

Please sign in to comment.