From 524f26d7a9e00213b2a265352690355240c67285 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 4 Feb 2019 02:48:56 -0600 Subject: [PATCH] mon/AuthMonitor: request max_global_id increase from peon in tick For authv2, we only increase max_global_id from tick, not via prep_auth(), so we need to ask the leader for more IDs here as we do there. Signed-off-by: Sage Weil --- src/mon/AuthMonitor.cc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 9ad76cdc46a23..4bff330c489be 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -71,13 +71,23 @@ void AuthMonitor::tick() dout(10) << *this << dendl; - if (!mon->is_leader()) return; - // increase global_id? bool propose = false; if (should_increase_max_global_id()) { - increase_max_global_id(); - propose = true; + if (mon->is_leader()) { + increase_max_global_id(); + propose = true; + } else { + dout(10) << __func__ << "requesting more ids from leader" << dendl; + int leader = mon->get_leader(); + MMonGlobalID *req = new MMonGlobalID(); + req->old_max_id = max_global_id; + mon->send_mon_message(req, leader); + } + } + + if (!mon->is_leader()) { + return; } if (check_rotate()) { -- 2.39.5