From f15880dc48bbcb4e7908ca86328aae11f4b2396a Mon Sep 17 00:00:00 2001 From: Patryk Wrobel Date: Tue, 23 Jan 2024 12:01:56 +0100 Subject: [PATCH] compaction_group::stop(): always call compaction_manager.remove() Before introduction of PR#15524 the removal had always been invoked via finally() continuation. In spite of making flush() noexcept, the mentioned PR modified the logic. If flush() returns exceptional future, then the removal is not performed. This change restores the old behavior - removal operation is always called. Since now, the logic of compaction_group::stop() is as follows: - firstly, it waits for completion of flush() via seastar::coroutine::as_future() to avoid premature exception - then it executes compaction_manager.remove() - in the end it inspects the future returned from flush() to re-throw the exception if the operation failed Fixed: scylladb#16751 Signed-off-by: Patryk Wrobel Closes scylladb/scylladb#16940 --- replica/table.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/replica/table.cc b/replica/table.cc index 289c0d38bd..81bddfc127 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -1784,8 +1784,13 @@ future<> compaction_group::stop() noexcept { co_return; } co_await _async_gate.close(); - co_await flush(); + + auto flush_future = co_await seastar::coroutine::as_future(flush()); co_await _t._compaction_manager.remove(as_table_state()); + + if (flush_future.failed()) { + co_await seastar::coroutine::return_exception_ptr(flush_future.get_exception()); + } } bool compaction_group::empty() const noexcept {