From: Jianpeng Ma Date: Tue, 7 Apr 2020 01:08:52 +0000 (+0800) Subject: os/bluesotre: call fsync before invalidatecache for FileWriter. X-Git-Tag: v16.1.0~2623^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=56e8535b150777cd691c058fc6b9cbdcaaf3189f;p=ceph.git os/bluesotre: call fsync before invalidatecache for FileWriter. FileWrier has own data cache, So we need fsync before invalidate cache. Signed-off-by: Jianpeng Ma --- diff --git a/src/os/bluestore/BlueRocksEnv.cc b/src/os/bluestore/BlueRocksEnv.cc index c7215caa1751e..b27421748605c 100644 --- a/src/os/bluestore/BlueRocksEnv.cc +++ b/src/os/bluestore/BlueRocksEnv.cc @@ -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(); }