]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
FileStore: sync object_map when we syncfs 4718/head
authorSamuel Just <sjust@redhat.com>
Fri, 1 May 2015 17:37:22 +0000 (10:37 -0700)
committerSamuel Just <sjust@redhat.com>
Fri, 29 May 2015 17:53:32 +0000 (10:53 -0700)
This way, even if leveldb/rocksdb is on another filesystem/disk,
it will still be synced before trimming the journal.  Note, this
patch only syncs the object_map in the !backend->can_checkpoint()
case since if the backend can checkpoint, the checkpoint must
also capture the object_map since we have not been setting replay
guards in the object_map.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/os/FileStore.cc

index 38c85330dbef80c7d334356c0e493c28348ca8a3..1fd9b5a161ca370f64bf8b8a613df696fc7903cd 100644 (file)
@@ -2021,7 +2021,12 @@ void FileStore::_set_global_replay_guard(coll_t cid,
     return;
 
   // sync all previous operations on this sequencer
-  int ret = sync_filesystem(basedir_fd);
+  int ret = object_map->sync();
+  if (ret < 0) {
+    derr << __func__ << " : omap sync error " << cpp_strerror(ret) << dendl;
+    assert(0 == "_set_global_replay_guard failed");
+  }
+  ret = sync_filesystem(basedir_fd);
   if (ret < 0) {
     derr << __func__ << " :sync_filesytem error " << cpp_strerror(ret) << dendl;
     assert(0 == "_set_global_replay_guard failed");
@@ -3624,6 +3629,7 @@ void FileStore::sync_entry()
        apply_manager.commit_started();
        op_tp.unpause();
 
+       object_map->sync();
        int err = backend->syncfs();
        if (err < 0) {
          derr << "syncfs got " << cpp_strerror(err) << dendl;