]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix flush_journal command
authorSage Weil <sage@redhat.com>
Sat, 11 Apr 2015 00:06:26 +0000 (17:06 -0700)
committerSage Weil <sage@redhat.com>
Wed, 19 Aug 2015 21:03:54 +0000 (17:03 -0400)
We need to sync_and_flush *and* sync() again in order to retire any items
in the FileStore journal.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/FileStore.cc
src/os/FileStore.h
src/os/ObjectStore.h
src/osd/OSD.cc

index d0ab348d6a394a7639e6d63c3fbe6e263c7d8c4f..0ec580a178ba32d64e46fe150b863068c672a133 100644 (file)
@@ -3842,6 +3842,14 @@ void FileStore::sync_and_flush()
   dout(10) << "sync_and_flush done" << dendl;
 }
 
+int FileStore::flush_journal()
+{
+  dout(10) << __func__ << dendl;
+  sync_and_flush();
+  sync();
+  return 0;
+}
+
 int FileStore::snapshot(const string& name)
 {
   dout(10) << "snapshot " << name << dendl;
index 710a1ad8c90d10dd1fb7b5b8dfd3b8bdbff78a34..fdff2742cac2e8eb4c79235517737cf2d12921cd 100644 (file)
@@ -577,6 +577,7 @@ public:
   void flush();
   void sync_and_flush();
 
+  int flush_journal();
   int dump_journal(ostream& out);
 
   void set_fsid(uuid_d u) {
index 5b72165360b1297c35970aaa46df3b2dd89b3ee4..7120db8b3211dae54d23b6faf7835947369f9849 100644 (file)
@@ -2100,6 +2100,8 @@ public:
   virtual void sync(Context *onsync) {}
   virtual void sync() {}
   virtual void flush() {}
+
+  virtual int flush_journal() { return -EOPNOTSUPP; }
   virtual void sync_and_flush() {}
 
   virtual int dump_journal(ostream& out) { return -EOPNOTSUPP; }
index 4fbcf7fc7a53c7cbc643f99dde9f5ea30cde4b8a..348724188cc2b6db5295c99f90ef142ef5977627 100644 (file)
@@ -1657,7 +1657,7 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format,
     }
     f->close_section();
   } else if (command == "flush_journal") {
-    store->sync_and_flush();
+    store->flush_journal();
   } else if (command == "dump_ops_in_flight" ||
             command == "ops") {
     if (!op_tracker.tracking_enabled) {