From: John Spray Date: Wed, 29 Apr 2015 20:48:53 +0000 (+0100) Subject: mon: add MonClient::flush_log X-Git-Tag: v9.0.1~27^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=88037760f06bacf0c3f3c9f0645267b741b5cd73;p=ceph.git mon: add MonClient::flush_log 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 --- diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 04de7e29b573..6624e6be3033 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -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; diff --git a/src/mon/MonClient.h b/src/mon/MonClient.h index 4df8320bb883..a9761d1df4b6 100644 --- a/src/mon/MonClient.h +++ b/src/mon/MonClient.h @@ -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 sub_have; // my subs, and current versions