Skip to content

Commit 3a7ce25

Browse files
maykovGunnar Kudrjavets
authored andcommitted
Calling SyncWAL instead of Write(<empty batch>)
Summary: Switching to the new way of syncing WAL. This diff requires the correspnding fix in rocksdb @update-submodule: rocksdb Test Plan: ran rocksd.write_sync Reviewers: yoshinorim Subscribers: kolmike, sdong Differential Revision: https://reviews.facebook.net/D46917
1 parent 7b065e3 commit 3a7ce25

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

storage/rocksdb/ha_rocksdb.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6112,7 +6112,6 @@ void* background_thread(void*)
61126112
mysql_mutex_lock(&background_mutex);
61136113
mysql_mutex_lock(&stop_cond_mutex);
61146114

6115-
rocksdb::WriteBatch wb;
61166115
time_t last_stat_recompute = 0;
61176116
for (;;)
61186117
{
@@ -6128,9 +6127,8 @@ void* background_thread(void*)
61286127
assert(ret == 0 || ret == ETIMEDOUT);
61296128

61306129
if (rdb && rocksdb_background_sync) {
6131-
auto wo = rocksdb::WriteOptions();
6132-
wo.sync = true;
6133-
rocksdb::Status s= rdb->Write(wo, &wb);
6130+
assert(!db_options.allow_mmap_writes);
6131+
rocksdb::Status s= rdb->SyncWAL();
61346132
if (!s.ok())
61356133
rocksdb_handle_io_error(s, ROCKSDB_IO_ERROR_BG_THREAD);
61366134
}

0 commit comments

Comments
 (0)