]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: sync_and_flush afer mkfs to create first snap
authorSamuel Just <samuel.just@dreamhost.com>
Thu, 10 Nov 2011 22:07:12 +0000 (14:07 -0800)
committerSamuel Just <samuel.just@dreamhost.com>
Thu, 10 Nov 2011 22:09:34 +0000 (14:09 -0800)
Previously, if we kill the OSD process before the filestore
does its first sync, we end up replaying the journal on top
of current and potentially hitting -EEXIST.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
src/osd/OSD.cc

index 6f1e8b1d76e799b136cf6bcd04d6dfeed9d5c6d8..0db64253fc0745f0b154f13d0b98f8e96c76fd01 100644 (file)
@@ -282,6 +282,7 @@ int OSD::mkfs(const std::string &dev, const std::string &jdev, ceph_fsid_t fsid,
       derr << "OSD::mkfs: couldn't mount FileStore: error " << ret << dendl;
       goto free_store;
     }
+    store->sync_and_flush();
     ret = write_meta(dev, fsid, whoami);
     if (ret) {
       derr << "OSD::mkfs: failed to write fsid file: error " << ret << dendl;