]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: once sync full is chosen, make sure we don't change our mind
authorSage Weil <sage@inktank.com>
Sat, 13 Jul 2013 15:11:45 +0000 (08:11 -0700)
committerSage Weil <sage@inktank.com>
Mon, 15 Jul 2013 17:02:47 +0000 (10:02 -0700)
It is possible for a sequence like:

 - probe
 - first probe reply has paxos trim that indicates a full sync is
   needed
 - start sync
 - clear store
 - something happens that makes us abort and bootstrap (e.g., the
   provider mon restarts
 - probe
 - first probe reply has older paxos trim bound and we call an election
 - on election completion, we crash because we have no data.

Non-determinism of the probe decision aside, we need to ensure that
the info we share during probe (fc, lc) is accurate, and that once we
clear the store we know we *must* do a full sync.

Fixes: #5621
Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/mon/Monitor.cc

index 86e8cc752c78ab4f4c2d03baf6dc379ecee9d61e..914714d733ca99b8951d824581903a97aa26f0ae 100644 (file)
@@ -853,6 +853,11 @@ void Monitor::sync_start(entity_inst_t &other, bool full)
     dout(10) << __func__ << " clearing prefixes " << targets << dendl;
     store->clear(targets);
 
+    // make sure paxos knows it has been reset.  this prevents a
+    // bootstrap and then different probe reply order from possibly
+    // deciding a partial or no sync is needed.
+    paxos->init();
+
     assert(g_conf->mon_sync_requester_kill_at != 2);
   }