From e63d960b8e52be5f5bac5a49c613802cc3471b3b Mon Sep 17 00:00:00 2001 From: Vladimir Krivopalov Date: Mon, 17 Sep 2018 11:04:25 -0700 Subject: [PATCH 1/7] tests: Enrich test_write_deleted_column with read after write. Signed-off-by: Vladimir Krivopalov --- tests/sstable_3_x_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sstable_3_x_test.cc b/tests/sstable_3_x_test.cc index 5600d48085..9adda9b1bd 100644 --- a/tests/sstable_3_x_test.cc +++ b/tests/sstable_3_x_test.cc @@ -3255,9 +3255,10 @@ SEASTAR_THREAD_TEST_CASE(test_write_deleted_column) { throw std::runtime_error("no column definition found"); } mut.set_cell(clustering_key::make_empty(), *column_def, atomic_cell::make_dead(write_timestamp, write_time_point)); - mt->apply(std::move(mut)); + mt->apply(mut); - write_and_compare_sstables(s, mt, table_name); + tmpdir tmp = write_and_compare_sstables(s, mt, table_name); + validate_read(s, tmp.path, {mut}); } SEASTAR_THREAD_TEST_CASE(test_write_deleted_row) { From 5b087daf9186eb52abf95ca5d3e3ead1e32c56c8 Mon Sep 17 00:00:00 2001 From: Vladimir Krivopalov Date: Mon, 17 Sep 2018 11:04:57 -0700 Subject: [PATCH 2/7] tests: Enrich test_write_simple_range_tombstone with read after write. Signed-off-by: Vladimir Krivopalov --- tests/sstable_3_x_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sstable_3_x_test.cc b/tests/sstable_3_x_test.cc index 9adda9b1bd..a2fe363df2 100644 --- a/tests/sstable_3_x_test.cc +++ b/tests/sstable_3_x_test.cc @@ -3764,9 +3764,10 @@ SEASTAR_THREAD_TEST_CASE(test_write_simple_range_tombstone) { tombstone tomb{write_timestamp, tp}; range_tombstone rt{clustering_key_prefix::from_single_value(*s, bytes("aaa")), clustering_key_prefix::from_single_value(*s, bytes("aaa")), tomb}; mut.partition().apply_delete(*s, std::move(rt)); - mt->apply(std::move(mut)); + mt->apply(mut); - write_and_compare_sstables(s, mt, table_name); + tmpdir tmp = write_and_compare_sstables(s, mt, table_name); + validate_read(s, tmp.path, {mut}); } // Test the case when for RTs their adjacent bounds are written as boundary RT markers. From 4bf9c87a1a240d754988341d3de7dd00776c3404 Mon Sep 17 00:00:00 2001 From: Vladimir Krivopalov Date: Mon, 17 Sep 2018 11:05:26 -0700 Subject: [PATCH 3/7] tests: Enrich test_write_adjacent_range_tombstones with read after write Signed-off-by: Vladimir Krivopalov --- tests/sstable_3_x_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sstable_3_x_test.cc b/tests/sstable_3_x_test.cc index a2fe363df2..b05538da72 100644 --- a/tests/sstable_3_x_test.cc +++ b/tests/sstable_3_x_test.cc @@ -3806,9 +3806,10 @@ SEASTAR_THREAD_TEST_CASE(test_write_adjacent_range_tombstones) { clustering_key::from_deeply_exploded(*s, {"aaa", "bbb"}), tomb}; mut.partition().apply_delete(*s, std::move(rt)); } - mt->apply(std::move(mut)); + mt->apply(mut); - write_and_compare_sstables(s, mt, table_name); + tmpdir tmp = write_and_compare_sstables(s, mt, table_name); + validate_read(s, tmp.path, {mut}); } // Test the case when subsequent RTs have a common clustering but those bounds are both exclusive From 6fbf4d358992bf0c7a25d68301c4011439345708 Mon Sep 17 00:00:00 2001 From: Vladimir Krivopalov Date: Mon, 17 Sep 2018 11:05:42 -0700 Subject: [PATCH 4/7] tests: Enrich test_write_non_adjacent_range_tombstones with read after write Signed-off-by: Vladimir Krivopalov --- tests/sstable_3_x_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sstable_3_x_test.cc b/tests/sstable_3_x_test.cc index b05538da72..7ffb0079c9 100644 --- a/tests/sstable_3_x_test.cc +++ b/tests/sstable_3_x_test.cc @@ -3849,9 +3849,10 @@ SEASTAR_THREAD_TEST_CASE(test_write_non_adjacent_range_tombstones) { clustering_key_prefix::from_single_value(*s, bytes("ccc")), bound_kind::excl_end}; mut.partition().apply_delete(*s, std::move(rt)); } - mt->apply(std::move(mut)); + mt->apply(mut); - write_and_compare_sstables(s, mt, table_name); + tmpdir tmp = write_and_compare_sstables(s, mt, table_name); + validate_read(s, tmp.path, {mut}); } SEASTAR_THREAD_TEST_CASE(test_write_mixed_rows_and_range_tombstones) { From 262874a90c1e4bb86ff1d6bb8993cde50c1b8be7 Mon Sep 17 00:00:00 2001 From: Vladimir Krivopalov Date: Mon, 17 Sep 2018 11:05:56 -0700 Subject: [PATCH 5/7] tests: Enrich test_write_mixed_rows_and_range_tombstones with read after write Signed-off-by: Vladimir Krivopalov --- tests/sstable_3_x_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sstable_3_x_test.cc b/tests/sstable_3_x_test.cc index 7ffb0079c9..f401520926 100644 --- a/tests/sstable_3_x_test.cc +++ b/tests/sstable_3_x_test.cc @@ -3920,9 +3920,10 @@ SEASTAR_THREAD_TEST_CASE(test_write_mixed_rows_and_range_tombstones) { clustering_key ckey = clustering_key::from_deeply_exploded(*s, {"ddd", "eee"}); mut.partition().apply_insert(*s, ckey, ts); } - mt->apply(std::move(mut)); + mt->apply(mut); - write_and_compare_sstables(s, mt, table_name); + tmpdir tmp = write_and_compare_sstables(s, mt, table_name); + validate_read(s, tmp.path, {mut}); } SEASTAR_THREAD_TEST_CASE(test_write_many_range_tombstones) { From f0966a935e6d1fbb1b08c1d966c300f560c0e66c Mon Sep 17 00:00:00 2001 From: Vladimir Krivopalov Date: Mon, 17 Sep 2018 11:06:10 -0700 Subject: [PATCH 6/7] tests: Enrich test_write_many_range_tombstones with read after write Signed-off-by: Vladimir Krivopalov --- tests/sstable_3_x_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sstable_3_x_test.cc b/tests/sstable_3_x_test.cc index f401520926..17c05fc72e 100644 --- a/tests/sstable_3_x_test.cc +++ b/tests/sstable_3_x_test.cc @@ -3952,9 +3952,10 @@ SEASTAR_THREAD_TEST_CASE(test_write_many_range_tombstones) { mut.partition().apply_delete(*s, std::move(rt)); seastar::thread::yield(); } - mt->apply(std::move(mut)); + mt->apply(mut); - write_and_compare_sstables(s, mt, table_name); + tmpdir tmp = write_and_compare_sstables(s, mt, table_name); + validate_read(s, tmp.path, {mut}); } SEASTAR_THREAD_TEST_CASE(test_write_adjacent_range_tombstones_with_rows) { From 8c08ccbd3b1c89589ca831cb5a9caa8ac9f5e759 Mon Sep 17 00:00:00 2001 From: Vladimir Krivopalov Date: Mon, 17 Sep 2018 11:06:24 -0700 Subject: [PATCH 7/7] tests: Enrich test_write_adjacent_range_tombstones_with_rows with read after write Signed-off-by: Vladimir Krivopalov --- tests/sstable_3_x_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sstable_3_x_test.cc b/tests/sstable_3_x_test.cc index 17c05fc72e..5285023be4 100644 --- a/tests/sstable_3_x_test.cc +++ b/tests/sstable_3_x_test.cc @@ -4007,9 +4007,10 @@ SEASTAR_THREAD_TEST_CASE(test_write_adjacent_range_tombstones_with_rows) { clustering_key ckey = clustering_key::from_deeply_exploded(*s, {"aaa", "ccc", "ccc"}); mut.partition().apply_insert(*s, ckey, ts); } - mt->apply(std::move(mut)); + mt->apply(mut); - write_and_compare_sstables(s, mt, table_name); + tmpdir tmp = write_and_compare_sstables(s, mt, table_name); + validate_read(s, tmp.path, {mut}); } SEASTAR_THREAD_TEST_CASE(test_write_range_tombstone_same_start_with_row) {