diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index 249a9a80c5..ba1ade2e3a 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -618,21 +618,12 @@ impl Tenant { // Remote preload is complete. drop(remote_load_completion); - let pending_deletion = { - match DeleteTenantFlow::should_resume_deletion( - conf, - preload.as_ref().map(|p| p.deleting).unwrap_or(false), - &tenant_clone, - ) - .await - { - Ok(should_resume_deletion) => should_resume_deletion, - Err(err) => { - make_broken(&tenant_clone, anyhow::anyhow!(err)); - return Ok(()); - } - } - }; + let pending_deletion = DeleteTenantFlow::should_resume_deletion( + conf, + preload.as_ref().map(|p| p.deleting).unwrap_or(false), + &tenant_clone, + ) + .await; info!("pending_deletion {}", pending_deletion.is_some()); diff --git a/pageserver/src/tenant/delete.rs b/pageserver/src/tenant/delete.rs index 066f239ff0..6a4bb47f68 100644 --- a/pageserver/src/tenant/delete.rs +++ b/pageserver/src/tenant/delete.rs @@ -361,25 +361,17 @@ impl DeleteTenantFlow { conf: &'static PageServerConf, remote_mark_exists: bool, tenant: &Tenant, - ) -> Result, DeleteTenantError> { - let acquire = |t: &Tenant| { + ) -> Option { + let tenant_id = tenant.tenant_id; + + if remote_mark_exists || conf.tenant_deleted_mark_file_path(&tenant_id).exists() { Some( - Arc::clone(&t.delete_progress) + Arc::clone(&tenant.delete_progress) .try_lock_owned() .expect("we're the only owner during init"), ) - }; - - if remote_mark_exists { - return Ok(acquire(tenant)); - } - - let tenant_id = tenant.tenant_id; - // Check local mark first, if its there there is no need to go to s3 to check whether remote one exists. - if conf.tenant_deleted_mark_file_path(&tenant_id).exists() { - Ok(acquire(tenant)) } else { - Ok(None) + None } }