tests/sstable_datafile_test: Add test for incorrect promoted index
Ensure we don't load incorrectly generated promoted indexes. Signed-off-by: Duarte Nunes <duarte@scylladb.com>
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
#include "cell_locking.hh"
|
||||
#include "simple_schema.hh"
|
||||
#include "memtable-sstable.hh"
|
||||
#include "tests/sstable_assertions.hh"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ftw.h>
|
||||
@@ -4343,3 +4344,28 @@ SEASTAR_TEST_CASE(compaction_correctness_with_partitioned_sstable_set) {
|
||||
.produces_end_of_stream();
|
||||
});
|
||||
}
|
||||
|
||||
SEASTAR_TEST_CASE(test_broken_promoted_index_is_skipped) {
|
||||
// create table ks.test (pk int, ck int, v int, primary key(pk, ck)) with compact storage;
|
||||
//
|
||||
// Populated with:
|
||||
//
|
||||
// insert into ks.test (pk, ck, v) values (1, 1, 1);
|
||||
// insert into ks.test (pk, ck, v) values (1, 2, 1);
|
||||
// insert into ks.test (pk, ck, v) values (1, 3, 1);
|
||||
// delete from ks.test where pk = 1 and ck = 2;
|
||||
return seastar::async([] {
|
||||
auto s = schema_builder("ks", "test")
|
||||
.with_column("pk", int32_type, column_kind::partition_key)
|
||||
.with_column("ck", int32_type, column_kind::clustering_key)
|
||||
.with_column("v", int32_type)
|
||||
.build(schema_builder::compact_storage::yes);
|
||||
|
||||
auto sst = sstables::make_sstable(s, "tests/sstables/broken_non_compound_pi_and_range_tombstone", 1, sstables::sstable::version_types::ka, big);
|
||||
sst->load().get0();
|
||||
|
||||
{
|
||||
assert_that(sst->get_index_reader(default_priority_class())).is_empty(*s);
|
||||
}
|
||||
});
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
2104758772
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
Scylla.db
|
||||
CompressionInfo.db
|
||||
Filter.db
|
||||
Statistics.db
|
||||
TOC.txt
|
||||
Digest.sha1
|
||||
Index.db
|
||||
Summary.db
|
||||
Data.db
|
||||
Reference in New Issue
Block a user