summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-24 17:58:48 -0700
committerSage Weil <sage@inktank.com>2013-06-24 17:59:14 -0700
commitc3b97591fd8206825bcfe65bdb24fbc75a2a9b42 (patch)
tree4a8860bfe5770ff165f49d8d0d57a27c6f2e5fce
parent0cc826c385edb2e327505696491d3ff1c3bfe8fd (diff)
downloadceph-c3b97591fd8206825bcfe65bdb24fbc75a2a9b42.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> (cherry picked from commit 521fdc2a4e65559b3da83283e6ca607b6e55406f)
-rw-r--r--src/mon/AuthMonitor.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc
index 391dc3c988b..db747b9dbe1 100644
--- a/src/mon/AuthMonitor.cc
+++ b/src/mon/AuthMonitor.cc
@@ -91,6 +91,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);
@@ -106,9 +111,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(bool *need_bootstrap)