]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon/MonClient: make get_mon_log_message() atomic 14422/head
authorKefu Chai <kchai@redhat.com>
Mon, 10 Apr 2017 06:53:46 +0000 (14:53 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 10 Apr 2017 06:58:05 +0000 (14:58 +0800)
commit5215e291da2b527d85e129eda86043490843178e
tree1970be68a3a0dd370787a0701460f46dc2c30867
parentb973c88dfaedb6f383aefc5396ead4d2ba791275
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>
src/common/LogClient.cc
src/common/LogClient.h
src/mon/MonClient.cc
src/mon/MonClient.h