diff --git a/HISTORY.md b/HISTORY.md index e6304896af..07d7425b9e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -7,6 +7,7 @@ * Blob file checksums are now printed in hexadecimal format when using the `manifest_dump` `ldb` command. * `GetLiveFilesMetaData()` now populates the `temperature`, `oldest_ancester_time`, and `file_creation_time` fields of its `LiveFileMetaData` results when the information is available. Previously these fields always contained zero indicating unknown. * Fix mismatches of OnCompaction{Begin,Completed} in case of DisableManualCompaction(). +* Fix continuous logging of an existing background error on every user write ### New Features * ldb has a new feature, `list_live_files_metadata`, that shows the live SST files, as well as their LSM storage level and the column family they belong to. diff --git a/db/db_impl/db_impl_write.cc b/db/db_impl/db_impl_write.cc index 6dcef62089..c2e8c0dc67 100644 --- a/db/db_impl/db_impl_write.cc +++ b/db/db_impl/db_impl_write.cc @@ -251,6 +251,7 @@ Status DBImpl::WriteImpl(const WriteOptions& write_options, write_thread_.EnterAsBatchGroupLeader(&w, &write_group); IOStatus io_s; + Status pre_release_cb_status; if (status.ok()) { // Rules for when we can update the memtable concurrently // 1. supported by memtable @@ -361,7 +362,7 @@ Status DBImpl::WriteImpl(const WriteOptions& write_options, writer->sequence, disable_memtable, writer->log_used, index++, pre_release_callback_cnt); if (!ws.ok()) { - status = ws; + status = pre_release_cb_status = ws; break; } } @@ -414,10 +415,13 @@ Status DBImpl::WriteImpl(const WriteOptions& write_options, if (!w.CallbackFailed()) { if (!io_s.ok()) { + assert(pre_release_cb_status.ok()); IOStatusCheck(io_s); } else { - WriteStatusCheck(status); + WriteStatusCheck(pre_release_cb_status); } + } else { + assert(io_s.ok() && pre_release_cb_status.ok()); } if (need_log_sync) {