From b66fbd6176152f0d67e8b230a78639fd3481adcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arpad=20M=C3=BCller?= Date: Thu, 6 Feb 2025 11:09:20 +0100 Subject: [PATCH] Warn on basebackups for archived timelines (#10688) We don't want any external requests for an archived timeline. This includes basebackup requests, i.e. when a compute is being started up. Therefore, we'd like to forbid such basebackup requests: any attempt to get a basebackup on an archived timeline (or any getpage request really) is a cplane bug. Make this a warning for now so that, if there is potentially a bug, we can detect cases in the wild before they cause stuck operations, but the intention is to return an error eventually. Related: #9548 --- pageserver/src/page_service.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pageserver/src/page_service.rs b/pageserver/src/page_service.rs index 679cf3b2d5..d4898532d6 100644 --- a/pageserver/src/page_service.rs +++ b/pageserver/src/page_service.rs @@ -2035,6 +2035,12 @@ impl PageServerHandler { .get(tenant_id, timeline_id, ShardSelector::Zero) .await?; + if timeline.is_archived() == Some(true) { + // TODO after a grace period, turn this log line into a hard error + tracing::warn!("timeline {tenant_id}/{timeline_id} is archived, but got basebackup request for it."); + //return Err(QueryError::NotFound("timeline is archived".into())) + } + let latest_gc_cutoff_lsn = timeline.get_latest_gc_cutoff_lsn(); if let Some(lsn) = lsn { // Backup was requested at a particular LSN. Wait for it to arrive.