Skip to content

Commit dbf97b6

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 <diwakar.sharma@datacore.com>
1 parent 0d8ac9c commit dbf97b6

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
@@ -104,6 +104,15 @@ impl<'n> Nexus<'n> {
104104
};
105105
nexus_info.children.push(child_info);
106106
});
107+
// We started with this child because it was healthy in etcd, or isn't there at all.
108+
// Being unhealthy here means it is undergoing a fault/retire before nexus is open.
109+
if nexus_info.children.len() == 1 && !nexus_info.children[0].healthy {
110+
warn!("{self:?} Not persisting: the only child went unhealthy during nexus creation");
111+
return Err(Error::NexusCreate {
112+
name: self.name.clone(),
113+
reason: "only child is unhealthy".to_string(),
114+
});
115+
}
107116
}
108117
PersistOp::AddChild {
109118
child_uri,

0 commit comments

Comments
 (0)