From cd6cb687711e06c7c558e8360971175b4a20062c Mon Sep 17 00:00:00 2001 From: Georgi Petrov Date: Mon, 19 Aug 2024 16:13:12 +0300 Subject: [PATCH] Limit 3 item ref key bypass to only when loading undeleted versions --- cpp/arcticdb/async/tasks.hpp | 2 -- cpp/arcticdb/version/version_map.hpp | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp/arcticdb/async/tasks.hpp b/cpp/arcticdb/async/tasks.hpp index 3e564e95045..d193eb75f36 100644 --- a/cpp/arcticdb/async/tasks.hpp +++ b/cpp/arcticdb/async/tasks.hpp @@ -375,8 +375,6 @@ struct CopyCompressedInterStoreTask : async::BaseTask { target_store->write_compressed_sync(key_segment_pair); } catch (const storage::DuplicateKeyException& e) { log::storage().debug("Key {} already exists on the target: {}", variant_key_view(key_to_read_), e.what()); - } catch (const storage::KeyNotFoundException& e) { - log::storage().debug("Key {} not found on the source: {}", variant_key_view(key_to_read_), e.what()); } catch (const std::exception& e) { auto name = target_store->name(); log::storage().error("Failed to write key {} to store {}: {}", variant_key_view(key_to_read_), name, e.what()); diff --git a/cpp/arcticdb/version/version_map.hpp b/cpp/arcticdb/version/version_map.hpp index 998ff3313b9..c97c7ef26d5 100644 --- a/cpp/arcticdb/version/version_map.hpp +++ b/cpp/arcticdb/version/version_map.hpp @@ -159,7 +159,10 @@ class VersionMapImpl { cached_penultimate_index = ref_entry.keys_[1]; } - if (key_exists_in_ref_entry(load_strategy, ref_entry, cached_penultimate_index)) { + // The 3 item ref key bypass can be used only when we are loading undeleted versions + // because otherwise it might skip versions that are deleted but part of snapshots + if (load_strategy.load_objective_ == LoadObjective::UNDELETED_ONLY + && key_exists_in_ref_entry(load_strategy, ref_entry, cached_penultimate_index)) { load_progress = ref_entry.load_progress_; entry->keys_.push_back(ref_entry.keys_[0]); if(cached_penultimate_index)