From 14a0517c7f5b8fa4fd3b1ecc758b076e6b538d00 Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Thu, 25 Jul 2024 09:23:41 +0000 Subject: [PATCH] also assert still ongoing --- pageserver/src/tenant/timeline/detach_ancestor.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pageserver/src/tenant/timeline/detach_ancestor.rs b/pageserver/src/tenant/timeline/detach_ancestor.rs index 9e92d4bb4a..add0857763 100644 --- a/pageserver/src/tenant/timeline/detach_ancestor.rs +++ b/pageserver/src/tenant/timeline/detach_ancestor.rs @@ -1132,6 +1132,10 @@ pub(super) async fn detach_and_reparent( if let Some(ancestor) = existing { Ancestor::Detached(ancestor, ancestor_lsn) } else { + assert!( + still_ongoing, + "cannot complete if the operation is not still ongoing" + ); let direct_children = reparented_direct_children(detached, tenant).map_err(Error::from)?; return Ok(DetachingAndReparenting::AlreadyDone(direct_children));