Skip to content

Commit

Permalink
remove tombstone part
Browse files Browse the repository at this point in the history
  • Loading branch information
shosseinimotlagh committed Feb 4, 2025
1 parent 688cd44 commit 5efc595
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
25 changes: 0 additions & 25 deletions src/tests/btree_helpers/btree_test_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,31 +167,6 @@ struct BtreeTestHelper {
do_put(k, put_type, V::generate_rand(), expect);
}

void move_to_tombstone(uint64_t k, btree_status_t expected_status=btree_status_t::success) {
auto existing_v = std::make_unique< V >();
K key = K{k};
V value = V{uint32_t(0)};
put_filter_cb_t filter_cb = [](BtreeKey const& key, BtreeValue const& existing_value, BtreeValue const& value) {
LOGINFO("Filter callback called for key={} existing existing {} new value {}", key.to_string(),
existing_value.to_string(), value.to_string());
if (existing_value.to_string() == V{uint32_t(0)}.to_string()) {
return put_filter_decision::keep;
}else {
return put_filter_decision::replace;
}
};
auto sreq = BtreeSinglePutRequest{&key, &value, btree_put_type::UPDATE, existing_v.get(), filter_cb};
sreq.enable_route_tracing();

auto const ret = m_bt->put(sreq);
if(expected_status != btree_status_t::success) {
ASSERT_EQ(ret, expected_status) << "UPDATING key=" << k << " failed with error=" << enum_name(ret);
}


}


void put_random() {
auto [start_k, end_k] = m_shadow_map.pick_random_non_existing_keys(1);
RELEASE_ASSERT_EQ(start_k, end_k, "Range scheduler pick_random_non_existing_keys issue");
Expand Down
17 changes: 0 additions & 17 deletions src/tests/test_mem_btree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,23 +241,6 @@ TYPED_TEST(BtreeTest, SimpleRemoveRange) {
// this->query_validate(0, num_entries , 75);
}

TYPED_TEST(BtreeTest, SimpleTombstone) {
// Forward sequential insert
const auto num_entries = 20;
LOGINFO("Step 1: Do forward sequential insert for {} entries", num_entries);
for (uint32_t i{0}; i < num_entries; ++i) {
this->put(i, btree_put_type::INSERT);
}
this->dump_to_file("tombstone1.dot");
this->move_to_tombstone(10, btree_status_t::success);
this->move_to_tombstone(10, btree_status_t::filtered_out);
this->dump_to_file("tombstone2.dot");
this->move_to_tombstone(40, btree_status_t::not_found);
this->dump_to_file("tombstone3.dot");
// this->query_validate(0, num_entries , 75);
}


TYPED_TEST(BtreeTest, RandomRemove) {
// Forward sequential insert
const auto num_entries = SISL_OPTIONS["num_entries"].as< uint32_t >();
Expand Down

0 comments on commit 5efc595

Please sign in to comment.