Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcolombo committed Dec 19, 2024
1 parent ce4a0d7 commit b7f5aa1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 34 deletions.
12 changes: 6 additions & 6 deletions nexus/db-queries/src/db/datastore/volume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4216,9 +4216,9 @@ mod tests {
id: volume_id,
target: vec![
// target to replace
SocketAddr::V6(region_addresses[0].clone()),
SocketAddr::V6(region_addresses[1].clone()),
SocketAddr::V6(region_addresses[2].clone()),
SocketAddr::V6(region_addresses[0]),
SocketAddr::V6(region_addresses[1]),
SocketAddr::V6(region_addresses[2]),
],
lossy: false,
flush_timeout: None,
Expand Down Expand Up @@ -4336,9 +4336,9 @@ mod tests {
opts: CrucibleOpts {
id: volume_id,
target: vec![
SocketAddr::V6(region_addresses[0].clone()), // back to what it was
SocketAddr::V6(region_addresses[1].clone()),
SocketAddr::V6(region_addresses[2].clone()),
SocketAddr::V6(region_addresses[0]), // back to what it was
SocketAddr::V6(region_addresses[1]),
SocketAddr::V6(region_addresses[2]),
],
lossy: false,
flush_timeout: None,
Expand Down
2 changes: 1 addition & 1 deletion nexus/src/app/sagas/snapshot_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ async fn ssc_start_running_snapshot(
));

info!(log, "map {} to {}", region_addr, snapshot_addr);
map.insert(region_addr, snapshot_addr.clone());
map.insert(region_addr, snapshot_addr);

// Once snapshot has been validated, and running snapshot has been
// started, add an entry in the region_snapshot table to correspond to
Expand Down
41 changes: 21 additions & 20 deletions nexus/tests/integration_tests/volume_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2284,9 +2284,9 @@ async fn test_keep_your_targets_straight(cptestctx: &ControlPlaneTestContext) {
opts: CrucibleOpts {
id: Uuid::new_v4(),
target: vec![
region_snapshots[0].3.clone(),
region_snapshots[1].3.clone(),
region_snapshots[2].3.clone(),
region_snapshots[0].3,
region_snapshots[1].3,
region_snapshots[2].3,
],
lossy: false,
flush_timeout: None,
Expand Down Expand Up @@ -2405,9 +2405,9 @@ async fn test_keep_your_targets_straight(cptestctx: &ControlPlaneTestContext) {
opts: CrucibleOpts {
id: Uuid::new_v4(),
target: vec![
region_snapshots[3].3.clone(),
region_snapshots[4].3.clone(),
region_snapshots[5].3.clone(),
region_snapshots[3].3,
region_snapshots[4].3,
region_snapshots[5].3,
],
lossy: false,
flush_timeout: None,
Expand Down Expand Up @@ -3567,7 +3567,7 @@ struct TestReadOnlyRegionReferenceUsage {
datastore: Arc<DataStore>,

region: db::model::Region,
region_address: SocketAddrV6,
region_address: SocketAddr,

first_volume_id: Uuid,
second_volume_id: Uuid,
Expand Down Expand Up @@ -3628,8 +3628,9 @@ impl TestReadOnlyRegionReferenceUsage {
// so fill in a random port here.
datastore.region_set_port(region.id(), 12345).await.unwrap();

let region_address =
datastore.region_addr(region.id()).await.unwrap().unwrap();
let region_address = SocketAddr::V6(
datastore.region_addr(region.id()).await.unwrap().unwrap(),
);

let region = datastore.get_region(region.id()).await.unwrap();

Expand Down Expand Up @@ -3660,7 +3661,7 @@ impl TestReadOnlyRegionReferenceUsage {
gen: 1,
opts: CrucibleOpts {
id: Uuid::new_v4(),
target: vec![SocketAddr::V6(self.region_address)],
target: vec![self.region_address],
lossy: false,
flush_timeout: None,
key: None,
Expand Down Expand Up @@ -3790,9 +3791,7 @@ impl TestReadOnlyRegionReferenceUsage {
gen: 1,
opts: CrucibleOpts {
id: Uuid::new_v4(),
target: vec![SocketAddr::V6(
self.region_address,
)],
target: vec![self.region_address],
lossy: false,
flush_timeout: None,
key: None,
Expand Down Expand Up @@ -3825,7 +3824,7 @@ impl TestReadOnlyRegionReferenceUsage {
gen: 1,
opts: CrucibleOpts {
id: Uuid::new_v4(),
target: vec![SocketAddr::V6(self.region_address)],
target: vec![self.region_address],
lossy: false,
flush_timeout: None,
key: None,
Expand Down Expand Up @@ -3860,7 +3859,7 @@ impl TestReadOnlyRegionReferenceUsage {
gen: 1,
opts: CrucibleOpts {
id: Uuid::new_v4(),
target: vec![SocketAddr::V6(self.region_address)],
target: vec![self.region_address],
lossy: false,
flush_timeout: None,
key: None,
Expand Down Expand Up @@ -5482,9 +5481,9 @@ async fn test_migrate_to_ref_count_with_records_region_snapshot_deleting(
opts: CrucibleOpts {
id: Uuid::new_v4(),
target: vec![
region_snapshots[1].3.clone(),
region_snapshots[2].3.clone(),
region_snapshots[3].3.clone(),
region_snapshots[1].3,
region_snapshots[2].3,
region_snapshots[3].3,
],
lossy: false,
flush_timeout: None,
Expand Down Expand Up @@ -5522,8 +5521,10 @@ async fn test_migrate_to_ref_count_with_records_region_snapshot_deleting(
);
assert_eq!(region_snapshot_to_delete.region_id, region_snapshots[0].1);
assert_eq!(region_snapshot_to_delete.snapshot_id, region_snapshots[0].2);
assert_eq!(region_snapshot_to_delete.snapshot_addr.parse::<SocketAddr>().unwrap(),
region_snapshots[0].3);
assert_eq!(
region_snapshot_to_delete.snapshot_addr.parse::<SocketAddr>().unwrap(),
region_snapshots[0].3
);
assert_eq!(region_snapshot_to_delete.volume_references, 0);
assert_eq!(region_snapshot_to_delete.deleting, true);

Expand Down
2 changes: 0 additions & 2 deletions sled-agent/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,6 @@ impl InstanceRunner {
format!("{id}:device")
}

// The basic spec enables COM1-COM4 by default. Everything else
// needs to be added manually.
let mut spec = propolis_client::types::InstanceSpecV0 {
board: Board {
chipset: Chipset::default(),
Expand Down
10 changes: 5 additions & 5 deletions sled-agent/src/sim/sled_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ use omicron_uuid_kinds::{
SupportBundleUuid, ZpoolUuid,
};
use oxnet::Ipv6Net;
use propolis_client::types::{
Board, Chipset, ComponentV0, SerialPort, SerialPortNumber,
};
use propolis_client::{
types::{InstanceInitializationMethod, InstanceSpecV0},
types::{
Board, Chipset, ComponentV0, InstanceInitializationMethod,
InstanceSpecV0, SerialPort, SerialPortNumber,
},
Client as PropolisClient, VolumeConstructionRequest,
};
use sled_agent_api::SupportBundleMetadata;
Expand Down Expand Up @@ -129,7 +129,7 @@ fn extract_targets_from_volume_construction_request(

VolumeConstructionRequest::Region { opts, .. } => {
for target in &opts.target {
res.push(target.clone());
res.push(*target);
}
}

Expand Down

0 comments on commit b7f5aa1

Please sign in to comment.