mirror of
https://github.com/ceph/ceph
synced 2025-02-24 19:47:44 +00:00
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 cd98eb0c65
.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
This commit is contained in:
parent
31d6062076
commit
521fdc2a4e
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user