]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kv/RocksDBStore: Don't use sync mode when disableWAL is set. 22612/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Tue, 19 Jun 2018 10:24:07 +0000 (18:24 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Mon, 29 Oct 2018 13:06:49 +0000 (21:06 +0800)
If disableWAL is set, it will met those error:
>> rocksdb: submit_common error: Invalid argument: Sync writes has to enable WAL. code = 4 Rocksdb transaction:

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/kv/RocksDBStore.cc

index 2f47cb5358f80def84e3b5dccc6d7dd82b32df8e..e45e60a80b6e91facb2ceb8446539fd2f589284f 100644 (file)
@@ -823,7 +823,8 @@ int RocksDBStore::submit_transaction_sync(KeyValueDB::Transaction t)
 {
   utime_t start = ceph_clock_now();
   rocksdb::WriteOptions woptions;
-  woptions.sync = true;
+  // if disableWAL, sync can't set
+  woptions.sync = !disableWAL;
   
   int result = submit_common(woptions, t);