From 9c662e65a23512e184a29695c988b2de1fd59edf Mon Sep 17 00:00:00 2001 From: Arseny Sher Date: Thu, 22 Feb 2024 09:50:14 +0300 Subject: [PATCH] Ignore aux files ingest and listing in basebackup for one tenant. As one off hack to make it run right now. --- pageserver/src/basebackup.rs | 32 +++++++++++++++++++------------- pageserver/src/walingest.rs | 9 ++++++++- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/pageserver/src/basebackup.rs b/pageserver/src/basebackup.rs index 7edfab75d4..0b04ba406d 100644 --- a/pageserver/src/basebackup.rs +++ b/pageserver/src/basebackup.rs @@ -13,6 +13,7 @@ use anyhow::{anyhow, bail, ensure, Context}; use bytes::{BufMut, Bytes, BytesMut}; use fail::fail_point; +use hex::FromHex; use pageserver_api::key::{key_to_slru_block, Key}; use postgres_ffi::pg_constants; use std::fmt::Write as FmtWrite; @@ -308,20 +309,25 @@ where } } - for (path, content) in self.timeline.list_aux_files(self.lsn, self.ctx).await? { - if path.starts_with("pg_replslot") { - let offs = pg_constants::REPL_SLOT_ON_DISK_OFFSETOF_RESTART_LSN; - let restart_lsn = Lsn(u64::from_le_bytes( - content[offs..offs + 8].try_into().unwrap(), - )); - info!("Replication slot {} restart LSN={}", path, restart_lsn); - min_restart_lsn = Lsn::min(min_restart_lsn, restart_lsn); + // one-off hack: disable listing aux files for this tenant + if self.timeline.tenant_shard_id.tenant_id + != utils::id::TenantId::from_hex("94dfb564f25964764b19763f337730ce").unwrap() + { + for (path, content) in self.timeline.list_aux_files(self.lsn, self.ctx).await? { + if path.starts_with("pg_replslot") { + let offs = pg_constants::REPL_SLOT_ON_DISK_OFFSETOF_RESTART_LSN; + let restart_lsn = Lsn(u64::from_le_bytes( + content[offs..offs + 8].try_into().unwrap(), + )); + info!("Replication slot {} restart LSN={}", path, restart_lsn); + min_restart_lsn = Lsn::min(min_restart_lsn, restart_lsn); + } + let header = new_tar_header(&path, content.len() as u64)?; + self.ar + .append(&header, &*content) + .await + .context("could not add aux file to basebackup tarball")?; } - let header = new_tar_header(&path, content.len() as u64)?; - self.ar - .append(&header, &*content) - .await - .context("could not add aux file to basebackup tarball")?; } } if min_restart_lsn != Lsn::MAX { diff --git a/pageserver/src/walingest.rs b/pageserver/src/walingest.rs index 8df2f1713a..7d0092e235 100644 --- a/pageserver/src/walingest.rs +++ b/pageserver/src/walingest.rs @@ -28,6 +28,7 @@ use postgres_ffi::{fsm_logical_to_physical, page_is_new, page_set_lsn}; use anyhow::{bail, Context, Result}; use bytes::{Buf, Bytes, BytesMut}; +use hex::FromHex; use tracing::*; use utils::failpoint_support; @@ -356,7 +357,13 @@ impl WalIngest { // a particular string, for example, but this is enough for now. failpoint_support::sleep_millis_async!("wal-ingest-logical-message-sleep"); } else if let Some(path) = prefix.strip_prefix("neon-file:") { - modification.put_file(path, message, ctx).await?; + // one off hack: disable aux file ingestion for this tenant + if modification.tline.tenant_shard_id.tenant_id + != utils::id::TenantId::from_hex("94dfb564f25964764b19763f337730ce") + .unwrap() + { + modification.put_file(path, message, ctx).await?; + } } } }