diff --git a/pageserver/src/tenant/timeline/detach_ancestor.rs b/pageserver/src/tenant/timeline/detach_ancestor.rs index 3e39ccf885..23419ecc82 100644 --- a/pageserver/src/tenant/timeline/detach_ancestor.rs +++ b/pageserver/src/tenant/timeline/detach_ancestor.rs @@ -1113,6 +1113,10 @@ pub(super) async fn detach_and_reparent( .is_some_and(|b| b.blocked_by_detach_ancestor()), ) }; + assert!( + still_ongoing, + "cannot (detach? reparent)? complete if the operation is not still ongoing" + ); let ancestor = if let Some(ancestor) = detached.ancestor_timeline.as_ref() { assert!( @@ -1135,10 +1139,6 @@ 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)); @@ -1154,10 +1154,6 @@ pub(super) async fn detach_and_reparent( // // if we crash after this operation, a retry will allow reparenting the remaining timelines as // gc is blocked. - assert!( - still_ongoing, - "to detach or reparent, gc must still be blocked" - ); let (ancestor, ancestor_lsn, was_detached) = match ancestor { Ancestor::NotDetached(ancestor, ancestor_lsn) => {