]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/AuthMonitor: be more careful with max_global_id
authorSage Weil <sage@redhat.com>
Tue, 15 Jan 2019 17:29:34 +0000 (11:29 -0600)
committerSage Weil <sage@redhat.com>
Thu, 7 Feb 2019 12:53:03 +0000 (06:53 -0600)
We're potentially handing out ids that haven't committed by increasing
max_global_id before it commits.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/AuthMonitor.cc

index f160eb852b5fc774d2e68f12cf1ae3b0bccde59d..852530a73a50886ea4f5ae3669f7cad26c1dee61 100644 (file)
@@ -293,11 +293,10 @@ void AuthMonitor::increase_max_global_id()
 {
   ceph_assert(mon->is_leader());
 
-  max_global_id += g_conf()->mon_globalid_prealloc;
   dout(10) << "increasing max_global_id to " << max_global_id << dendl;
   Incremental inc;
   inc.inc_type = GLOBAL_ID;
-  inc.max_global_id = max_global_id;
+  inc.max_global_id = max_global_id + g_conf()->mon_globalid_prealloc;
   pending_auth.push_back(inc);
 }