From 4d627affc33b6b384315dadf21ee2800cc52fca6 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Tue, 16 Nov 2021 13:20:19 +0100 Subject: [PATCH] lsa: Mark compact_segment_locked() as noexcept We cannot recover from a failure in this method. The implementation makes sure it never happens. Invariants will be broken if this throws. Detect violations early by marking as noexcept. We could make it exception safe and try to leave the data structures in a consistent state but the reclaimer cannot make progress if this throws, so it's pointless. Refs #9192 Message-Id: <20211116122019.813418-1-tgrabiec@scylladb.com> --- utils/logalloc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/logalloc.cc b/utils/logalloc.cc index cdbfc16352..e5882d12cb 100644 --- a/utils/logalloc.cc +++ b/utils/logalloc.cc @@ -1457,7 +1457,7 @@ private: } } - void compact_segment_locked(segment* seg, segment_descriptor& desc) { + void compact_segment_locked(segment* seg, segment_descriptor& desc) noexcept { auto seg_occupancy = desc.occupancy(); llogger.debug("Compacting segment {} from region {}, {}", fmt::ptr(seg), id(), seg_occupancy);