Skip to content

Commit

Permalink
Limit 3 item ref key bypass to only when loading undeleted versions
Browse files Browse the repository at this point in the history
  • Loading branch information
G-D-Petrov committed Aug 19, 2024
1 parent 7f152ce commit cd6cb68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions cpp/arcticdb/async/tasks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
5 changes: 4 additions & 1 deletion cpp/arcticdb/version/version_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cd6cb68

Please sign in to comment.