]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: make attempts of auth rotating configurable
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 17 Dec 2016 07:44:58 +0000 (15:44 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 20 Dec 2016 00:45:01 +0000 (08:45 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/common/config_opts.h
src/mds/MDSDaemon.cc
src/osd/OSD.cc

index fb074b50f7def0c37612e3c9e0ed1a7e0d86a147..929a76d3e17ddaf69891bf47422e6d6bd88d2b3a 100644 (file)
@@ -381,6 +381,7 @@ OPTION(auth_cluster_required, OPT_STR, "cephx")   // required of mon, mds, osd d
 OPTION(auth_service_required, OPT_STR, "cephx")   // required by daemons of clients
 OPTION(auth_client_required, OPT_STR, "cephx, none")     // what clients require of daemons
 OPTION(auth_supported, OPT_STR, "")               // deprecated; default value for above if they are not defined.
+OPTION(max_rotating_auth_attempts, OPT_INT, 10)
 OPTION(cephx_require_signatures, OPT_BOOL, false) //  If true, don't talk to Cephx partners if they don't support message signing; off by default
 OPTION(cephx_cluster_require_signatures, OPT_BOOL, false)
 OPTION(cephx_service_require_signatures, OPT_BOOL, false)
index d9c60fb986a011b72420829b69c8fe0aa805eb94..7088c23ecdc6e7ebc5adbd5ca048570759452526 100644 (file)
@@ -497,10 +497,8 @@ int MDSDaemon::init()
   }
 
   int rotating_auth_attempts = 0;
-  const int max_rotating_auth_attempts = 10;
-
   while (monc->wait_auth_rotating(30.0) < 0) {
-    if (++rotating_auth_attempts <= max_rotating_auth_attempts) {
+    if (++rotating_auth_attempts <= g_conf->max_rotating_auth_attempts) {
       derr << "unable to obtain rotating service keys; retrying" << dendl;
       continue;
     }
index a5963412e0db9c9511fe416a7e39cda245190f25..2b39bfe50ca556ad5efca1a3199624f204ea124c 100644 (file)
@@ -2059,7 +2059,6 @@ int OSD::init()
   }
 
   int rotating_auth_attempts = 0;
-  const int max_rotating_auth_attempts = 10;
 
   // sanity check long object name handling
   {
@@ -2273,7 +2272,7 @@ int OSD::init()
   while (monc->wait_auth_rotating(30.0) < 0) {
     derr << "unable to obtain rotating service keys; retrying" << dendl;
     ++rotating_auth_attempts;
-    if (rotating_auth_attempts > max_rotating_auth_attempts) {
+    if (rotating_auth_attempts > g_conf->max_rotating_auth_attempts) {
         osd_lock.Lock(); // make locker happy
         if (!is_stopping()) {
             r = - ETIMEDOUT;