From f1b917c2cc189209d33487299b92d92eb4a654bc Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 31 Jan 2019 09:29:45 -0600 Subject: [PATCH] mon: defer initial connection auth attempts until initial quorum is formed Otherwise e.g. a client.admin connectin will fail because the mon doesn't have the key in the database yet. Signed-off-by: Sage Weil --- src/mon/Monitor.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 2fe98293373..45c013daeb4 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -6082,6 +6082,13 @@ int Monitor::handle_auth_request( return -EACCES; } + // wait until we've formed an initial quorum on mkfs so that we have + // the initial keys (e.g., client.admin). + if (authmon()->get_last_committed() == 0) { + dout(10) << __func__ << " haven't formed initial quorum, EBUSY" << dendl; + return -EBUSY; + } + RefCountedPtr priv; MonSession *s; int32_t r = 0; -- 2.39.5