Skip to content

Commit 0ac6532

Browse files
committed
fix up stuff
1 parent 7b7dd98 commit 0ac6532

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

nexus/src/app/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ pub struct Nexus {
202202
default_region_allocation_strategy: RegionAllocationStrategy,
203203

204204
/// Channel for notifying background task of change to opte v2p state
205+
#[allow(dead_code)]
206+
// XXX(eliza) do we need this or can we just activate the background task?
205207
v2p_notification_tx: tokio::sync::watch::Sender<()>,
206208
}
207209

nexus/src/app/sagas/instance_update/destroyed.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,15 @@
55
use super::ActionRegistry;
66
use super::NexusActionContext;
77
use super::NexusSaga;
8-
use super::STATE;
98
use crate::app::sagas::declare_saga_actions;
109
use crate::app::sagas::ActionError;
1110
use nexus_db_model::Generation;
1211
use nexus_db_model::Instance;
1312
use nexus_db_model::InstanceRuntimeState;
14-
use nexus_db_model::Vmm;
1513
use nexus_db_queries::authn;
1614
use nexus_db_queries::authz;
17-
use nexus_db_queries::db::datastore::InstanceAndVmms;
1815
use omicron_common::api::external;
1916
use omicron_common::api::external::Error;
20-
use omicron_common::api::external::InstanceState;
2117
use serde::{Deserialize, Serialize};
2218
use slog::info;
2319
use uuid::Uuid;
@@ -81,7 +77,7 @@ pub(super) struct Params {
8177
}
8278

8379
#[derive(Debug)]
84-
pub(crate) struct SagaVmmDestroyed;
80+
pub(super) struct SagaVmmDestroyed;
8581
impl NexusSaga for SagaVmmDestroyed {
8682
const NAME: &'static str = "instance-update-vmm-destroyed";
8783
type Params = Params;
@@ -106,18 +102,6 @@ impl NexusSaga for SagaVmmDestroyed {
106102
}
107103
}
108104

109-
fn get_destroyed_vmm(
110-
sagactx: &NexusActionContext,
111-
) -> Result<Option<(Instance, Vmm)>, ActionError> {
112-
let state = sagactx.lookup::<InstanceAndVmms>(STATE)?;
113-
match state.active_vmm {
114-
Some(vmm) if vmm.runtime.state.state() == &InstanceState::Destroyed => {
115-
Ok(Some((state.instance, vmm)))
116-
}
117-
_ => Ok(None),
118-
}
119-
}
120-
121105
async fn siud_release_sled_resources(
122106
sagactx: NexusActionContext,
123107
) -> Result<(), ActionError> {

nexus/src/app/sagas/instance_update/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use super::{
99
use crate::app::db::datastore::InstanceAndVmms;
1010
use crate::app::sagas::declare_saga_actions;
1111
use nexus_db_queries::{authn, authz};
12-
use nexus_types::identity::Resource;
1312
use omicron_common::api::external::InstanceState;
1413
use serde::{Deserialize, Serialize};
1514
use steno::{ActionError, DagBuilder, Node, SagaName};
@@ -38,7 +37,6 @@ struct RealParams {
3837
}
3938

4039
const INSTANCE_LOCK_ID: &str = "saga_instance_lock_id";
41-
const STATE: &str = "state";
4240

4341
// instance update saga: actions
4442

@@ -63,7 +61,7 @@ declare_saga_actions! {
6361
// Become the instance updater
6462
BECOME_UPDATER -> "generation" {
6563
+ siu_become_updater
66-
- siu_lock_instance_undo
64+
- siu_unbecome_updater
6765
}
6866

6967
UNLOCK_INSTANCE -> "unlocked" {
@@ -84,7 +82,7 @@ impl NexusSaga for SagaInstanceUpdate {
8482
}
8583

8684
fn make_saga_dag(
87-
params: &Self::Params,
85+
_params: &Self::Params,
8886
mut builder: DagBuilder,
8987
) -> Result<steno::Dag, super::SagaInitError> {
9088
builder.append(Node::action(
@@ -214,7 +212,7 @@ async fn siu_fetch_state_and_start_real_saga(
214212
state,
215213
})
216214
.await
217-
.map_err(ActionError::action_failed);
215+
.map_err(ActionError::action_failed)?;
218216

219217
Ok(())
220218
}

0 commit comments

Comments
 (0)