From: Sage Weil Date: Sat, 11 Apr 2015 00:06:26 +0000 (-0700) Subject: osd: fix flush_journal command X-Git-Tag: v9.1.0~324^2~27 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=30e4978018fa0e691817c76fb16557a1973dc61f;p=ceph.git osd: fix flush_journal command We need to sync_and_flush *and* sync() again in order to retire any items in the FileStore journal. Signed-off-by: Sage Weil --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index d0ab348d6a39..0ec580a178ba 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -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; diff --git a/src/os/FileStore.h b/src/os/FileStore.h index 710a1ad8c90d..fdff2742cac2 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -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) { diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 5b72165360b1..7120db8b3211 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -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; } diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 4fbcf7fc7a53..348724188cc2 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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) {