From 4ddbc0e46d02c43faeadd7de20130d27e17f7e78 Mon Sep 17 00:00:00 2001 From: Konstantin Knizhnik Date: Wed, 25 Oct 2023 20:35:23 +0300 Subject: [PATCH] Ignore missed AUX_FILES_KEY when generating image layer (#5660) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem Logical replication requires new AUX_FILES_KEY which is definitely absent in existed database. We do not have function to check if key exists in our KV storage. So I have to handle the error in `list_aux_files` method. But this key is also included in key space range and accessed y `create_image_layer` method. ## Summary of changes Check if AUX_FILES_KEY exists before including it in keyspace. --------- Co-authored-by: Konstantin Knizhnik Co-authored-by: Shany Pozin Co-authored-by: Arpad Müller --- pageserver/src/pgdatadir_mapping.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pageserver/src/pgdatadir_mapping.rs b/pageserver/src/pgdatadir_mapping.rs index d27c8a3d5d..52c44746dc 100644 --- a/pageserver/src/pgdatadir_mapping.rs +++ b/pageserver/src/pgdatadir_mapping.rs @@ -675,8 +675,9 @@ impl Timeline { result.add_key(CONTROLFILE_KEY); result.add_key(CHECKPOINT_KEY); - result.add_key(AUX_FILES_KEY); - + if self.get(AUX_FILES_KEY, lsn, ctx).await.is_ok() { + result.add_key(AUX_FILES_KEY); + } Ok(result.to_keyspace()) }