mds: avoid key renew storm on clock skew

Check 918c12c2ab (diff-fa6c2eba8356ae1442d1bf749beacfdf)
for detail information.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
xie xingguo 2016-04-05 09:31:11 +08:00
parent 7dae094c0f
commit da27c33b69

View File

@ -474,8 +474,21 @@ int MDSDaemon::init(MDSMap::DaemonState wanted_state)
mds_lock.Unlock();
return r;
}
int rotating_auth_attempts = 0;
const int max_rotating_auth_attempts = 10;
while (monc->wait_auth_rotating(30.0) < 0) {
derr << "unable to obtain rotating service keys; retrying" << dendl;
if (++rotating_auth_attempts <= max_rotating_auth_attempts) {
derr << "unable to obtain rotating service keys; retrying" << dendl;
continue;
}
derr << "ERROR: failed to refresh rotating keys, "
<< "maximum retry time reached." << dendl;
mds_lock.Lock();
suicide();
mds_lock.Unlock();
return -ETIMEDOUT;
}
objecter->start();