replica: Kill table::calculate_shard_from_sstable_generation()

Inferring shard from generation is long gone. We still use it in
some scripts, but that's no longer needed in Scylla, when loading
the SSTables, and it also conflicts with ongoing work of UUID-based
generations.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>

Closes #12476
This commit is contained in:
Raphael S. Carvalho
2023-01-09 10:34:54 -03:00
committed by Avi Kivity
parent 548c9e36a1
commit 05ffb024bb
3 changed files with 2 additions and 11 deletions

View File

@@ -102,6 +102,7 @@ void run_sstable_resharding_test() {
BOOST_REQUIRE(new_sstables.size() == smp::count);
uint64_t bloom_filter_size_after = 0;
std::unordered_set<shard_id> processed_shards;
for (auto& sstable : new_sstables) {
auto new_sst = env.reusable_sst(s, tmp.path().string(), generation_value(sstable->generation()),
@@ -111,7 +112,7 @@ void run_sstable_resharding_test() {
auto shards = new_sst->get_shards_for_this_sstable();
BOOST_REQUIRE(shards.size() == 1); // check sstable is unshared.
auto shard = shards.front();
BOOST_REQUIRE(column_family_test::calculate_shard_from_sstable_generation(generation_value(new_sst->generation())) == shard);
BOOST_REQUIRE(processed_shards.insert(shard).second == true); // check resharding created one sstable per shard.
auto rd = assert_that(new_sst->as_mutation_source().make_reader_v2(s, env.make_reader_permit()));
BOOST_REQUIRE(muts[shard].size() == keys_per_shard);

View File

@@ -50,10 +50,6 @@ public:
return generation_value(cf.calculate_generation_for_new_table());
}
static int64_t calculate_shard_from_sstable_generation(int64_t generation) {
return replica::column_family::calculate_shard_from_sstable_generation(generation_from_value(generation));
}
auto try_flush_memtable_to_sstable(lw_shared_ptr<replica::memtable> mt) {
auto cg = _cf->single_compaction_group_if_available();
assert(cg);