mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-24 00:20:37 +00:00
fix: return reparented_direct_children in case we reparent nothing new
This commit is contained in:
@@ -1056,7 +1056,7 @@ pub(super) async fn complete(
|
||||
.context("publish layers and detach ancestor")?;
|
||||
}
|
||||
|
||||
let (mut reparented, reparented_all) =
|
||||
let (reparented, reparented_all) =
|
||||
if let Some((ancestor, ancestor_lsn)) = ancestor.as_branchpoint() {
|
||||
assert!(detach_is_ongoing, "to reparent, gc must still be blocked");
|
||||
let mut tasks = tokio::task::JoinSet::new();
|
||||
@@ -1176,22 +1176,22 @@ pub(super) async fn complete(
|
||||
candidates = reparenting_candidates,
|
||||
"failed to reparent all candidates; they will be retried after the restart",
|
||||
);
|
||||
|
||||
// TODO: two-state Ok(return_value)?
|
||||
(Vec::new(), false)
|
||||
} else {
|
||||
reparented.sort_unstable();
|
||||
|
||||
let reparented = reparented
|
||||
.into_iter()
|
||||
.map(|(_, timeline_id)| timeline_id)
|
||||
.collect();
|
||||
|
||||
(reparented, true)
|
||||
}
|
||||
(reparented, reparented_all)
|
||||
} else {
|
||||
// FIXME: again, get the list of (ancestor_lsn, reparented)
|
||||
(Vec::new(), true)
|
||||
(reparented_direct_children(detached, tenant)?, true)
|
||||
};
|
||||
|
||||
reparented.sort_unstable();
|
||||
|
||||
let reparented = reparented
|
||||
.into_iter()
|
||||
.map(|(_, timeline_id)| timeline_id)
|
||||
.collect();
|
||||
|
||||
// FIXME: here everything has gone peachy, the tenant will be restarted next.
|
||||
// after restart and before returning the response, the gc blocking must be undone
|
||||
|
||||
Ok((reparented, reparented_all))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user