rename complete_detaching_from_ancestor

it hasn't meant completing in a while now :)
This commit is contained in:
Joonas Koivunen
2024-07-19 14:42:16 +00:00
parent c6d8015fe9
commit dfdf40916f
3 changed files with 14 additions and 9 deletions

View File

@@ -2025,7 +2025,7 @@ impl TenantManager {
let timeline = tenant.get_timeline(timeline_id, true)?;
let (resp, reparented_all) = timeline
.complete_detaching_timeline_ancestor(&tenant, prepared, ctx)
.detach_from_ancestor_and_reparent(&tenant, prepared, ctx)
.await?;
let mut slot_guard = slot_guard.into_inner();

View File

@@ -4746,18 +4746,23 @@ impl Timeline {
detach_ancestor::prepare(self, tenant, options, ctx).await
}
/// Completes the ancestor detach. This method is to be called while holding the
/// TenantManager's tenant slot, so during this method we cannot be deleted nor can any
/// timeline be deleted. After this method returns successfully, tenant must be reloaded.
/// Second step of detach from ancestor; detaches the `self` from it's current ancestor and
/// reparents any reparentable children of previous ancestor.
///
/// This method is to be called while
/// holding the TenantManager's tenant slot, so during this method we cannot be deleted nor can
/// any timeline be deleted. After this method returns successfully, tenant must be reloaded.
///
/// Final step will be to complete after optionally resetting the tenant.
///
/// Pageserver receiving a SIGKILL during this operation is not supported (yet).
pub(crate) async fn complete_detaching_timeline_ancestor(
pub(crate) async fn detach_from_ancestor_and_reparent(
self: &Arc<Timeline>,
tenant: &crate::tenant::Tenant,
prepared: detach_ancestor::PreparedTimelineDetach,
ctx: &RequestContext,
) -> Result<(Vec<TimelineId>, bool), anyhow::Error> {
detach_ancestor::complete(self, tenant, prepared, ctx).await
) -> Result<detach_ancestor::DetachingAndReparenting, anyhow::Error> {
detach_ancestor::detach_and_reparent(self, tenant, prepared, ctx).await
}
/// Switch aux file policy and schedule upload to the index part.

View File

@@ -970,8 +970,8 @@ async fn remote_copy(
.map_err(CopyFailed)
}
/// See [`Timeline::complete_detaching_timeline_ancestor`].
pub(super) async fn complete(
/// See [`Timeline::detach_from_ancestor_and_reparent`].
pub(super) async fn detach_and_reparent(
detached: &Arc<Timeline>,
tenant: &Tenant,
prepared: PreparedTimelineDetach,