From a145ffcf52d864c1acff2c763f69c0fe2df00e09 Mon Sep 17 00:00:00 2001 From: "Raphael S. Carvalho" Date: Fri, 27 Aug 2021 17:35:17 -0300 Subject: [PATCH] compaction: don't rule out compacting sstables in validate-mode scrub even sstables being compacted must be validated. otherwise scrub validate may return false negative. Signed-off-by: Raphael S. Carvalho --- compaction/compaction_manager.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compaction/compaction_manager.cc b/compaction/compaction_manager.cc index b9e3236900..2a9cac6718 100644 --- a/compaction/compaction_manager.cc +++ b/compaction/compaction_manager.cc @@ -765,7 +765,9 @@ future<> compaction_manager::rewrite_sstables(column_family* cf, sstables::compa } future<> compaction_manager::perform_sstable_scrub_validate_mode(column_family* cf) { - return run_custom_job(cf, sstables::compaction_type::Scrub, [this, &cf = *cf, sstables = get_candidates(*cf)] () mutable -> future<> { + // All sstables must be included, even the ones being compacted, such that everything in table is validated. + auto all_sstables = boost::copy_range>(*cf->get_sstables()); + return run_custom_job(cf, sstables::compaction_type::Scrub, [this, &cf = *cf, sstables = std::move(all_sstables)] () mutable -> future<> { class pending_tasks { compaction_manager::stats& _stats; size_t _n;