]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: sync object_map on _set_replay_guard()
authorSage Weil <sage@newdream.net>
Sat, 10 Mar 2012 00:34:55 +0000 (16:34 -0800)
committerSage Weil <sage@newdream.net>
Sat, 10 Mar 2012 00:34:55 +0000 (16:34 -0800)
We need to sync the object_map too.  We can _almost_ check to see if there
are keys for the object and only do it then, except that they may have
existed previously and then been deleted.

So, always sync.  leveldb is reasonably nice about this... it should just
be another fsync.

Signed-off-by: Sage Weil <sage@newdream.net>
src/os/FileStore.cc

index 4ee8cfd6c02ab7e16e64a76069261f81f7299ca7..4f8c3e55c84c1bc14d9c50a4042d19fb9933ffdd 100644 (file)
@@ -2356,6 +2356,11 @@ void FileStore::_set_replay_guard(int fd, const SequencerPosition& spos)
   // first make sure the previous operation commits
   ::fsync(fd);
 
+  // sync object_map too.  even if this object has a header or keys,
+  // it have had them in the past and then removed them, so always
+  // sync.
+  object_map->sync();
+
   // then record that we did it
   bufferlist v(40);
   ::encode(spos, v);