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
main
Maysam Yabandeh 7 years ago committed by Facebook Github Bot
parent 58b841b356
commit 0ef3fdd732
  1. 2
      db/db_impl_write.cc

@ -697,7 +697,7 @@ Status DBImpl::PreprocessWrite(const WriteOptions& write_options,
} }
if (UNLIKELY(status.ok() && !bg_error_.ok())) { if (UNLIKELY(status.ok() && !bg_error_.ok())) {
return bg_error_; status = bg_error_;
} }
if (UNLIKELY(status.ok() && !flush_scheduler_.Empty())) { if (UNLIKELY(status.ok() && !flush_scheduler_.Empty())) {

Loading…
Cancel
Save