Skip to content

Commit 17248a1

Browse files
committed
fix(nexus): don't persist if child faults during nexus create
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. Signed-off-by: Diwakar Sharma <[email protected]>
1 parent 9b92b9f commit 17248a1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

io-engine/src/bdev/nexus/nexus_persistence.rs

+9
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ impl<'n> Nexus<'n> {
103103
};
104104
nexus_info.children.push(child_info);
105105
});
106+
// We started with this child because it was healthy in etcd, or isn't there at all.
107+
// Being unhealthy here means it is undergoing a fault/retire before nexus is open.
108+
if nexus_info.children.len() == 1 && !nexus_info.children[0].healthy {
109+
warn!("{self:?} Not persisting: the only child went unhealthy during nexus creation");
110+
return Err(Error::NexusCreate {
111+
name: self.name.clone(),
112+
reason: "only child is unhealthy".to_string(),
113+
});
114+
}
106115
}
107116
PersistOp::AddChild { child_uri, healthy } => {
108117
// Add the state of a new child. This should only be called

0 commit comments

Comments
 (0)