Skip to content

Commit

Permalink
mutation_query_test: test that range tombstones are sent in reverse q…
Browse files Browse the repository at this point in the history
…ueries

Reproducer for scylladb#10598.
  • Loading branch information
michoecho committed Nov 8, 2023
1 parent 957be6f commit 4b99611
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/boost/mutation_query_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -583,3 +583,22 @@ SEASTAR_THREAD_TEST_CASE(test_frozen_mutation_consumer) {
const auto& rebuilt = *res.result;
BOOST_REQUIRE_EQUAL(rebuilt, m);
}

// Reproducer for #10598
SEASTAR_THREAD_TEST_CASE(test_reverse_range_tombstones) {
auto now = gc_clock::now();
tests::reader_concurrency_semaphore_wrapper semaphore;
schema_ptr table_schema = make_schema();
schema_ptr query_schema = table_schema->make_reversed();
mutation m(table_schema, partition_key::from_single_value(*table_schema, "key1"));
auto rt = range_tombstone(
clustering_key::from_single_value(*table_schema, "ck0"), bound_kind::incl_start,
clustering_key::from_single_value(*table_schema, "ck1"), bound_kind::incl_end,
tombstone(api::timestamp_type(42), now)
);
m.partition().apply_delete(*table_schema, rt);
auto src = make_source({m});
auto slice = partition_slice_builder(*query_schema).reversed().build();
reconcilable_result result = mutation_query(query_schema, semaphore.make_permit(), src, query::full_partition_range, slice, query::max_rows, query::max_partitions, now);
assert_that(result.partitions().at(0).mut().unfreeze(table_schema)).is_equal_to(m);
}

0 comments on commit 4b99611

Please sign in to comment.