Skip to content

Commit

Permalink
Merge #1780
Browse files Browse the repository at this point in the history
1780: fix(nexus): don't persist if child faults during nexus create r=dsharma-dc a=dsharma-dc

When nexus is being created with a single child, and that child goes into retire path before nexus is open, then the child gets persisted as unhealthy. This will cause volume to never be able to attach later on.

Co-authored-by: Diwakar Sharma <[email protected]>
  • Loading branch information
mayastor-bors and dsharma-dc committed Dec 11, 2024
2 parents 9b92b9f + 17248a1 commit 40855ce
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions io-engine/src/bdev/nexus/nexus_persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@ impl<'n> Nexus<'n> {
};
nexus_info.children.push(child_info);
});
// We started with this child because it was healthy in etcd, or isn't there at all.
// Being unhealthy here means it is undergoing a fault/retire before nexus is open.
if nexus_info.children.len() == 1 && !nexus_info.children[0].healthy {
warn!("{self:?} Not persisting: the only child went unhealthy during nexus creation");
return Err(Error::NexusCreate {
name: self.name.clone(),
reason: "only child is unhealthy".to_string(),
});
}
}
PersistOp::AddChild { child_uri, healthy } => {
// Add the state of a new child. This should only be called
Expand Down

0 comments on commit 40855ce

Please sign in to comment.