Skip to content

Commit

Permalink
explicitly say source repair address, and expand comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jmpesp committed Aug 13, 2024
1 parent f2b9fc7 commit a2bda34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nexus/src/app/crucible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl super::Nexus {
}

/// Call out to Crucible agent and perform region creation. Optionally,
/// supply a read-only source to invoke a clone.
/// supply a read-only source's repair address to invoke a clone.
pub async fn ensure_region_in_dataset(
&self,
log: &Logger,
Expand Down
9 changes: 5 additions & 4 deletions nexus/src/app/sagas/region_snapshot_replacement_start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ async fn rsrss_new_region_ensure(
// downstairs port. Once this goes away, Nexus will require a way to query
// for the repair port!

let mut repair_addr: SocketAddrV6 =
let mut source_repair_addr: SocketAddrV6 =
match region_snapshot.snapshot_addr.parse() {
Ok(addr) => addr,

Expand All @@ -425,16 +425,17 @@ async fn rsrss_new_region_ensure(
}
};

repair_addr
.set_port(repair_addr.port() + crucible_common::REPAIR_PORT_OFFSET);
source_repair_addr.set_port(
source_repair_addr.port() + crucible_common::REPAIR_PORT_OFFSET,
);

let ensured_region = osagactx
.nexus()
.ensure_region_in_dataset(
log,
&new_dataset,
&new_region,
Some(repair_addr.to_string()),
Some(source_repair_addr.to_string()),
)
.await
.map_err(ActionError::action_failed)?;
Expand Down

0 comments on commit a2bda34

Please sign in to comment.