Skip to content

Commit

Permalink
AER-6566 - remove record from secondary index(es) during data-in-memo…
Browse files Browse the repository at this point in the history
…ry cold starts where a later version of the record is expired/evicted, and during cold start eviction.
  • Loading branch information
gooding470 committed Aug 19, 2022
1 parent fc40e3d commit 32a0efb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions as/src/base/nsup.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "sindex/gc.h"
#include "storage/storage.h"
#include "transaction/delete.h"
#include "transaction/rw_utils.h"

#include "warnings.h"

Expand Down Expand Up @@ -1251,6 +1252,8 @@ cold_start_evict_reduce_cb(as_index_ref* r_ref, void* udata)
}
else if (! per_thread->sets_not_evicting[as_index_get_set_id(r)] &&
ns->evict_void_time > void_time) {
remove_from_sindex(ns, r_ref); // no-op unless data-in-memory

as_index_tree* tree = per_thread->rsv->tree;

// Note - can't be a tombstone.
Expand Down
2 changes: 2 additions & 0 deletions as/src/storage/drv_ssd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2475,6 +2475,7 @@ ssd_cold_start_add_record(drv_ssds* ssds, drv_ssd* ssd,
// Skip records that have expired.
if (opt_meta.void_time != 0 && ns->cold_start_now > opt_meta.void_time) {
if (! is_create) {
remove_from_sindex(ns, &r_ref); // no-op unless data-in-memory
as_set_index_delete_live(ns, p_partition->tree, r, r_ref.r_h);
}

Expand All @@ -2488,6 +2489,7 @@ ssd_cold_start_add_record(drv_ssds* ssds, drv_ssd* ssd,
if (opt_meta.void_time != 0 && ns->evict_void_time > opt_meta.void_time &&
drv_is_set_evictable(ns, &opt_meta)) {
if (! is_create) {
remove_from_sindex(ns, &r_ref); // no-op unless data-in-memory
as_set_index_delete_live(ns, p_partition->tree, r, r_ref.r_h);
}

Expand Down

0 comments on commit 32a0efb

Please sign in to comment.