From 03b8baaa8d313a750b5a9ce52c8a71cce28bc2eb Mon Sep 17 00:00:00 2001 From: Calle Wilund Date: Mon, 31 May 2021 13:33:48 +0000 Subject: [PATCH] commitlog: Recycle or not should not depend on shutdown state If we are using recycling, we should always use recycle in delete_segments, otherwise we can cause deadlock with replenish task, since it will be waiting for segment, then shutdown is set, and we are called, and can't fulfil the alloc -> deadlock --- db/commitlog/commitlog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/commitlog/commitlog.cc b/db/commitlog/commitlog.cc index 9d1907465d..409dd010f9 100644 --- a/db/commitlog/commitlog.cc +++ b/db/commitlog/commitlog.cc @@ -1802,7 +1802,7 @@ future<> db::commitlog::segment_manager::delete_segments(std::vector fi } // We allow reuse of the segment if the current disk size is less than shard max. - if (!_shutdown && cfg.reuse_segments) { + if (cfg.reuse_segments) { auto usage = totals.total_size_on_disk; auto recycle = usage <= max_disk_size;