@@ -98,7 +98,6 @@ Status DBImpl::SyncClosedLogs(JobContext* job_context) {
98
98
Status s;
99
99
if (!logs_to_sync.empty ()) {
100
100
log_write_mutex_.Unlock ();
101
- mutex_.Unlock ();
102
101
103
102
for (log ::Writer* log : logs_to_sync) {
104
103
ROCKS_LOG_INFO (immutable_db_options_.info_log ,
@@ -125,9 +124,7 @@ Status DBImpl::SyncClosedLogs(JobContext* job_context) {
125
124
// "number <= current_log_number - 1" is equivalent to
126
125
// "number < current_log_number".
127
126
MarkLogsSynced (current_log_number - 1 , true , s);
128
- mutex_.Lock ();
129
127
if (!s.ok ()) {
130
- error_handler_.SetBGError (s, BackgroundErrorReason::kFlush );
131
128
TEST_SYNC_POINT (" DBImpl::SyncClosedLogs:Failed" );
132
129
return s;
133
130
}
@@ -177,7 +174,9 @@ Status DBImpl::FlushMemTableToOutputFile(
177
174
// flushed SST may contain data from write batches whose updates to
178
175
// other column families are missing.
179
176
// SyncClosedLogs() may unlock and re-lock the db_mutex.
177
+ mutex_.Unlock ();
180
178
s = SyncClosedLogs (job_context);
179
+ mutex_.Lock ();
181
180
} else {
182
181
TEST_SYNC_POINT (" DBImpl::SyncClosedLogs:Skip" );
183
182
}
@@ -359,7 +358,9 @@ Status DBImpl::AtomicFlushMemTablesToOutputFiles(
359
358
if (logfile_number_ > 0 ) {
360
359
// TODO (yanqin) investigate whether we should sync the closed logs for
361
360
// single column family case.
361
+ mutex_.Unlock ();
362
362
s = SyncClosedLogs (job_context);
363
+ mutex_.Lock ();
363
364
}
364
365
365
366
// exec_status stores the execution status of flush_jobs as
0 commit comments