diff options
author | Sage Weil <sage@inktank.com> | 2013-06-24 17:58:48 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-06-24 17:58:48 -0700 |
commit | 521fdc2a4e65559b3da83283e6ca607b6e55406f (patch) | |
tree | 2840c20c162712157a5e19efee71028de1d34789 | |
parent | 31d6062076fdbcd2691c07a23b381b26abc59f65 (diff) | |
download | ceph-521fdc2a4e65559b3da83283e6ca607b6e55406f.tar.gz |
mon/AuthMonitor: ensure initial rotating keys get encoded when create_initial called 2x
The create_initial() method may get called multiple times; make sure it
will unconditionally generate new/initial rotating keys. Move the block
up so that we can easily assert as much.
Broken by commit cd98eb0c651d9ee62e19c2cc92eadae9bed678cd.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/mon/AuthMonitor.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 301133af2e5..24542564e8e 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -96,6 +96,11 @@ void AuthMonitor::create_initial() { dout(10) << "create_initial -- creating initial map" << dendl; + // initialize rotating keys + last_rotating_ver = 0; + check_rotate(); + assert(pending_auth.size() == 1); + KeyRing keyring; bufferlist bl; int ret = mon->store->get("mkfs", "keyring", bl); @@ -111,9 +116,6 @@ void AuthMonitor::create_initial() inc.inc_type = GLOBAL_ID; inc.max_global_id = max_global_id; pending_auth.push_back(inc); - - // initalize rotating keys, too - check_rotate(); } void AuthMonitor::update_from_paxos() |