]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mon/MonClient: make get_mon_log_message() atomic 14588/head
authorKefu Chai <kchai@redhat.com>
Mon, 10 Apr 2017 06:53:46 +0000 (14:53 +0800)
committerAlexey Sheplyakov <asheplyakov@mirantis.com>
Mon, 17 Apr 2017 11:14:43 +0000 (15:14 +0400)
commit02afe9855a4d04fe56951a9e9ffd3e32537ff77e
treefeb0046f7d411506ef71bb3586df6198736d90a4
parent432bc8b4168e70a68e53795dea538882f83a9a8e
mon/MonClient: make get_mon_log_message() atomic

* LogClient: move reset_session() into get_mon_log_message() and add a
  "flush" param to the latter. so it can get_mon_log_message()
  atomically. otherwise another call changing the log queue could sneak
  in between reset_session() and get_mon_log_message().
* MonClient: add a "flush" param to do_send() so we can reset the
  LogClient session once we are connected to a monitor.

Fixes: http://tracker.ceph.com/issues/19427
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 5215e291da2b527d85e129eda86043490843178e)

Conflicts:
src/mon/MonClient.cc: handle_auth: replaced 'log_client->reset_session();
send_log();' sequence with newly introduced 'send_log(true);' like
the original patch does
src/common/LogClient.cc
src/common/LogClient.h
src/mon/MonClient.cc
src/mon/MonClient.h