]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: defer initial connection auth attempts until initial quorum is formed
authorSage Weil <sage@redhat.com>
Thu, 31 Jan 2019 15:29:45 +0000 (09:29 -0600)
committerSage Weil <sage@redhat.com>
Thu, 7 Feb 2019 18:10:34 +0000 (12:10 -0600)
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 <sage@redhat.com>
src/mon/Monitor.cc

index 2fe98293373a9417e4df76a39344e8f3b1fc99be..45c013daeb419ef99e7ce07c7d23392dc856840e 100644 (file)
@@ -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;