]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mon/AuthMonitor: provide auth_lock-safe _assign_global_id()
authorSage Weil <sage@redhat.com>
Wed, 20 Feb 2019 23:09:06 +0000 (17:09 -0600)
committerSage Weil <sage@redhat.com>
Wed, 20 Feb 2019 23:30:31 +0000 (17:30 -0600)
commitf7099f72faccb09aea5054c0b428bf89be67141c
treef464f0167e7bb3ddfe07d9cc79f19cf6e8fb7b48
parent2124d439073dfa3640789f34d2d96246023b1286
mon/AuthMonitor: provide auth_lock-safe _assign_global_id()

Break assign_global_id() into two parts:

- _assign_global_id(), called under auth_lock, that does nothing but
  assign an id (or fail).  This makes use of the num_mon and num_rank
  values, which means it only works while we are in quorum.
- increase_max_global_id(), if it looks like we should.

Also, adjust _should_increase_max_global_id() to also work under auth_lock
since we are looking at last_allocated_id.  All last_allocated_id users
are not protected by auth_lock.

Fixes: http://tracker.ceph.com/issues/38372
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/AuthMonitor.cc
src/mon/AuthMonitor.h