]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add MonClient::flush_log
authorJohn Spray <john.spray@redhat.com>
Wed, 29 Apr 2015 20:48:53 +0000 (21:48 +0100)
committerJohn Spray <john.spray@redhat.com>
Fri, 1 May 2015 18:37:08 +0000 (19:37 +0100)
A simple reasonable-effort call for emitting
a MLog before shutting down.  Used in MDS which
also waits for its beacon to be acked, so due to
message ordering implicitly waits for this to land
too -- no need to implement a waiting log flush
for this use case.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mon/MonClient.cc
src/mon/MonClient.h

index 04de7e29b573a49ddf4e5c9a700e4200231c9e51..6624e6be30335e27882698d0178bdd0c385bd4f4 100644 (file)
@@ -314,6 +314,12 @@ void MonClient::send_log()
   }
 }
 
+void MonClient::flush_log()
+{
+  Mutex::Locker l(monc_lock);
+  send_log();
+}
+
 void MonClient::handle_monmap(MMonMap *m)
 {
   ldout(cct, 10) << "handle_monmap " << *m << dendl;
index 4df8320bb883738f7e365c3a42e91b83c8f740c8..a9761d1df4b64e345a09925b58929d8c79936380 100644 (file)
@@ -200,6 +200,13 @@ public:
 
   int authenticate(double timeout=0.0);
 
+  /**
+   * Try to flush as many log messages as we can in a single
+   * message.  Use this before shutting down to transmit your
+   * last message.
+   */
+  void flush_log();
+
   // mon subscriptions
 private:
   map<string,ceph_mon_subscribe_item> sub_have;  // my subs, and current versions