fix: must_restart condition

This commit is contained in:
Joonas Koivunen
2024-07-19 15:24:13 +00:00
parent 1348dbf0f1
commit 7f767ca18e

View File

@@ -1069,7 +1069,7 @@ pub(super) async fn detach_and_reparent(
"to detach and reparent, gc must still be blocked"
);
let (ancestor, ancestor_lsn) = match ancestor {
let (ancestor, ancestor_lsn, was_detached) = match ancestor {
Ancestor::NotDetached(ancestor, ancestor_lsn) => {
// this has to complete before any reparentings because otherwise they would not have
// layers on the new parent.
@@ -1082,9 +1082,9 @@ pub(super) async fn detach_and_reparent(
.await
.context("publish layers and detach ancestor")?;
(ancestor, ancestor_lsn)
(ancestor, ancestor_lsn, true)
}
Ancestor::Detached(ancestor, ancestor_lsn) => (ancestor, ancestor_lsn),
Ancestor::Detached(ancestor, ancestor_lsn) => (ancestor, ancestor_lsn, false),
};
let mut tasks = tokio::task::JoinSet::new();
@@ -1215,7 +1215,7 @@ pub(super) async fn detach_and_reparent(
Ok(DetachingAndReparenting::Reparented(reparented))
} else {
Ok(DetachingAndReparenting::SomeReparentingFailed {
must_restart: reparented.is_empty(),
must_restart: !reparented.is_empty() || was_detached,
})
}
}