From a985ea0fcbb9032bdcf20e8ca455001b83a498fa Mon Sep 17 00:00:00 2001 From: Duarte Nunes Date: Sat, 24 Mar 2018 14:08:22 +0000 Subject: [PATCH] column_family: Don't retry flushing memtable if shutdown is requested Since we just keep retrying, this can cause Scylla to not shutdown for a while. The data will be safe in the commit log. Note that this patch doesn't fix the issue when shutdown goes through storage_service::drain_on_shutdown - more work is required to handle that case. Ref #3318. Signed-off-by: Duarte Nunes Message-Id: <20180324140822.3743-3-duarte@scylladb.com> --- database.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database.cc b/database.cc index 17913bb66a..fc1afa3326 100644 --- a/database.cc +++ b/database.cc @@ -1073,7 +1073,7 @@ column_family::try_flush_memtable_to_sstable(lw_shared_ptr old, sstabl // If we failed this write we will try the write again and that will create a new flush reader // that will decrease dirty memory again. So we need to reset the accounting. old->revert_flushed_memory(); - return stop_iteration::no; + return stop_iteration(_async_gate.is_closed()); }); }); });