From 0ef3fdd73272c01d6a843cc7a8675187bb40f1ff Mon Sep 17 00:00:00 2001 From: Maysam Yabandeh Date: Wed, 20 Dec 2017 08:10:19 -0800 Subject: [PATCH] Disable need_log_sync on bg err Summary: When there is a background error PreprocessWrite returns without marking the logs synced. If we keep need_log_sync to true, it would try to sync them at the end, which would break the logic. The patch would unset need_log_sync if the logs end up not being marked for sync in PreprocessWrite. Closes https://github.com/facebook/rocksdb/pull/3293 Differential Revision: D6602347 Pulled By: maysamyabandeh fbshipit-source-id: 37ee04209e8dcfd78de891654ce50d0954abeb38 --- db/db_impl_write.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db_impl_write.cc b/db/db_impl_write.cc index f1c7665e0..48ea729a8 100644 --- a/db/db_impl_write.cc +++ b/db/db_impl_write.cc @@ -697,7 +697,7 @@ Status DBImpl::PreprocessWrite(const WriteOptions& write_options, } if (UNLIKELY(status.ok() && !bg_error_.ok())) { - return bg_error_; + status = bg_error_; } if (UNLIKELY(status.ok() && !flush_scheduler_.Empty())) {