]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluesotre: call fsync before invalidatecache for FileWriter. 34231/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Tue, 7 Apr 2020 01:08:52 +0000 (09:08 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Tue, 7 Apr 2020 01:15:54 +0000 (09:15 +0800)
FileWrier has own data cache, So we need fsync before invalidate cache.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueRocksEnv.cc

index c7215caa1751e7354961c1a49da9ee0a1bcbe0b5..b27421748605c66f343af231ecbf7d12186552c6 100644 (file)
@@ -257,6 +257,7 @@ class BlueRocksWritableFile : public rocksdb::WritableFile {
   // If the system is not caching the file contents, then this is a noop.
   // This call has no effect on dirty pages in the cache.
   rocksdb::Status InvalidateCache(size_t offset, size_t length) override {
+    fs->fsync(h);
     fs->invalidate_cache(h->file, offset, length);
     return rocksdb::Status::OK();
   }