From 84f2e99c054d305bf2a71e8d02ead776de68efa3 Mon Sep 17 00:00:00 2001 From: Lakshmi Narayanan Sreethar Date: Thu, 4 Sep 2025 21:09:16 +0530 Subject: [PATCH] compaction/scrub: handle exceptions when moving invalid sstables to quarantine In validate mode, scrub moves invalid sstables into the quarantine folder. If validation fails because the sstable files are missing from disk, there is nothing to move, and the quarantine step will throw an exception. Handle such exceptions so scrub can return a proper compaction_result instead of propagating the exception to the caller. This will help the testcase for #23363 to reliably determine if the scrub has failed or not. Signed-off-by: Lakshmi Narayanan Sreethar --- compaction/compaction.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compaction/compaction.cc b/compaction/compaction.cc index 4fa44cce63..1f9cf4b88b 100644 --- a/compaction/compaction.cc +++ b/compaction/compaction.cc @@ -2006,7 +2006,11 @@ static future scrub_sstables_validate_mode(sstables::compacti using scrub = sstables::compaction_type_options::scrub; if (validation_errors != 0 && descriptor.options.as().quarantine_sstables == scrub::quarantine_invalid_sstables::yes) { for (auto& sst : descriptor.sstables) { - co_await sst->change_state(sstables::sstable_state::quarantine); + try { + co_await sst->change_state(sstables::sstable_state::quarantine); + } catch (...) { + clogger.error("Moving {} to quarantine failed due to {}, continuing.", sst->get_filename(), std::current_exception()); + } } }