Skip to content

Commit

Permalink
log when Gone is seen, along with what dataset is Gone
Browse files Browse the repository at this point in the history
add missing format!
  • Loading branch information
jmpesp committed May 25, 2024
1 parent 9e8fcc1 commit 0baa9c8
Showing 1 changed file with 49 additions and 17 deletions.
66 changes: 49 additions & 17 deletions nexus/src/app/crucible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,15 @@ impl super::Nexus {

// Return Ok if the dataset's agent is gone, no delete call
// is required.
Err(Error::Gone) => return Ok(()),
Err(Error::Gone) => {
warn!(
log,
"dataset is gone";
"dataset_id" => %dataset.id(),
);

return Ok(());
}

Err(e) => return Err(e),
}
Expand All @@ -460,26 +468,34 @@ impl super::Nexus {
backoff::retry_notify(
backoff::retry_policy_internal_service_aggressive(),
|| async {
let region = match self.maybe_get_crucible_region(
log,
dataset,
region_id,
).await {
Ok(None) => {
Err(BackoffError::Permanent(WaitError::Permanent(
Error::internal_error(
"dataset {dataset_id} region {region_id} is missing now!",
)
)))
}
let region = match self
.maybe_get_crucible_region(log, dataset, region_id)
.await
{
Ok(None) => Err(BackoffError::Permanent(
WaitError::Permanent(Error::internal_error(&format!(
"dataset {} region {region_id} is missing now!",
dataset.id(),
))),
)),

Ok(Some(v)) => Ok(v),

// Return Ok if the dataset's agent is gone, no
// delete call is required.
Err(Error::Gone) => return Ok(()),
Err(Error::Gone) => {
warn!(
log,
"dataset is gone";
"dataset_id" => %dataset.id(),
);

Err(e) => Err(BackoffError::Permanent(WaitError::Permanent(e))),
return Ok(());
}

Err(e) => {
Err(BackoffError::Permanent(WaitError::Permanent(e)))
}
}?;

match region.state {
Expand Down Expand Up @@ -557,7 +573,15 @@ impl super::Nexus {

// Return Ok if the dataset's agent is gone, no
// delete call is required.
Err(Error::Gone) => return Ok(()),
Err(Error::Gone) => {
warn!(
log,
"dataset is gone";
"dataset_id" => %dataset.id(),
);

return Ok(());
}

Err(e) => Err(BackoffError::Permanent(WaitError::Permanent(e))),
}?;
Expand Down Expand Up @@ -694,7 +718,15 @@ impl super::Nexus {

// Return Ok if the dataset's agent is gone, no
// delete call is required.
Err(Error::Gone) => return Ok(()),
Err(Error::Gone) => {
warn!(
log,
"dataset is gone";
"dataset_id" => %dataset.id(),
);

return Ok(());
}

Err(e) => {
Err(BackoffError::Permanent(WaitError::Permanent(e)))
Expand Down

0 comments on commit 0baa9c8

Please sign in to comment.