diff options
author | Joao Eduardo Luis <joao.luis@inktank.com> | 2013-04-30 16:05:08 +0100 |
---|---|---|
committer | Joao Eduardo Luis <joao.luis@inktank.com> | 2013-04-30 16:05:08 +0100 |
commit | 40d0ec6df12e0123cd730a9032da649fe148cd42 (patch) | |
tree | d953aa43f6a13f8ec95675787461e3de9b81bafe | |
parent | 195f0e7aa5716d7c3b24bb9ea9efb5ef53b4b10f (diff) | |
download | ceph-40d0ec6df12e0123cd730a9032da649fe148cd42.tar.gz |
mon: Monitor: force zap of election messages when synchronizing
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r-- | src/mon/Monitor.cc | 7 | ||||
-rw-r--r-- | src/mon/Monitor.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 739f9b9d182..a96122f0c36 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -3036,7 +3036,7 @@ void Monitor::send_command(const entity_inst_t& inst, try_send_message(c, inst); } -void Monitor::waitlist_or_zap_client(Message *m) +void Monitor::waitlist_or_zap_client(Message *m, bool force_zap) { /** * Wait list the new session until we're in the quorum, assuming it's @@ -3055,7 +3055,7 @@ void Monitor::waitlist_or_zap_client(Message *m) utime_t too_old = ceph_clock_now(g_ceph_context); too_old -= g_ceph_context->_conf->mon_lease; if (m->get_recv_stamp() > too_old && - con->is_connected()) { + con->is_connected() && !force_zap) { dout(5) << "waitlisting message " << *m << dendl; maybe_wait_for_quorum.push_back(new C_RetryMessage(this, m)); } else { @@ -3129,7 +3129,8 @@ bool Monitor::_ms_dispatch(Message *m) dout(20) << " caps " << s->caps.get_str() << dendl; if (is_synchronizing() && !src_is_mon) { - waitlist_or_zap_client(m); + bool force_zap = (m->get_type() == MSG_MON_ELECTION); + waitlist_or_zap_client(m, force_zap); return true; } diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index 1a19914ba92..03eb593185e 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -1332,7 +1332,7 @@ public: void resend_routed_requests(); void remove_session(MonSession *s); void remove_all_sessions(); - void waitlist_or_zap_client(Message *m); + void waitlist_or_zap_client(Message *m, bool force_zap = false); void send_command(const entity_inst_t& inst, const vector<string>& com, version_t version); |