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
This commit is contained in:
Calle Wilund
2021-05-31 13:33:48 +00:00
parent 5ebf5835b0
commit 03b8baaa8d

View File

@@ -1802,7 +1802,7 @@ future<> db::commitlog::segment_manager::delete_segments(std::vector<sstring> 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;