mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-21 23:20:40 +00:00
fix: must_restart condition
This commit is contained in:
@@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user