diff options
author | Joao Eduardo Luis <joao.luis@inktank.com> | 2013-03-22 00:49:28 +0000 |
---|---|---|
committer | Joao Eduardo Luis <joao.luis@inktank.com> | 2013-03-22 01:21:00 +0000 |
commit | 71ec9c6bd54d560cc2bca4b6d0dbb3e6961df135 (patch) | |
tree | e3f4d0ac0a2dfba15483a53dc7ecc508b9360cda | |
parent | d67eee1d11d313817fae5a672ab835777a6601e2 (diff) | |
download | ceph-71ec9c6bd54d560cc2bca4b6d0dbb3e6961df135.tar.gz |
mon: AuthMonitor: delete auth_handler while increasing max_global_id
By not deleting and setting NULL the session's auth_handler, we could
hit a scenario in which we'd end up dispatching a previously-wait-listed
auth message and we wouldn't start its auth session.
This only happened when increasing max_global_id via Paxos (in which case
we would wait-list the message) and would only be noticeable when running
with cephx disabled.
Fixes: #4519
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r-- | src/mon/AuthMonitor.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 0761137784e..f521ede6e79 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -440,14 +440,16 @@ bool AuthMonitor::prep_auth(MAuth *m, bool paxos_writable) if (!s->global_id) { s->global_id = assign_global_id(m, paxos_writable); if (!s->global_id) { + + delete s->auth_handler; + s->auth_handler = NULL; + if (mon->is_leader() && paxos_writable) { dout(10) << "increasing global id, waitlisting message" << dendl; wait_for_active(new C_RetryMessage(this, m)); goto done; } - delete s->auth_handler; - s->auth_handler = NULL; s->put(); if (!mon->is_leader()) { |