From: Sage Weil Date: Thu, 31 Jan 2019 15:29:45 +0000 (-0600) Subject: mon: defer initial connection auth attempts until initial quorum is formed X-Git-Tag: v14.1.0~183^2~25 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f1b917c2cc189209d33487299b92d92eb4a654bc;p=ceph.git 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 --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 2fe98293373a9..45c013daeb419 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;