]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mon: fix scrub vs paxos race: refresh on commit, not round completion
authorSage Weil <sage@inktank.com>
Fri, 12 Jul 2013 21:47:09 +0000 (14:47 -0700)
committerSage Weil <sage@inktank.com>
Mon, 15 Jul 2013 19:54:56 +0000 (12:54 -0700)
commitf1ce8d7c955a2443111bf7d9e16b4c563d445712
treea04e4941f1b2e133a0d74928303fcdbbb355ea8b
parentefe5b67bb700ef6218d9579abf43cc9ecf25ef52
mon: fix scrub vs paxos race: refresh on commit, not round completion

Consider:

 - paxos starts a commit N+1
 - a majority of the peers ack it
  - paxos::commit() writes N+1 it to disk
  - tells peers to commit
 - peers commit N+1, *and* refresh_from_paxos(), and generate N+1 full map
 - leader does _scrub on N+1, without latest full osdmap
 - peers do _scrub on N+1, with latest full osdmap
 - leader finishes paxos gather, does refresh_from_paxos()
 -> scrub fails.

Fix this by doing the refresh_from_paxos() at commit time and not when
the paxos round finishes.  We move the refresh out of finish_proposal
and into its own helper, and update all callers accordingly.  This
keeps on-disk state more tightly in sync with in-memory state and
avoids the need for a e.g., kludgey workaround in the scrub code.

We also simplify the bootstrap checks a bit by doing so immediately
and relying on the normal bootstrap paxos reset paths to clean up
any waiters.

Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Paxos.cc
src/mon/Paxos.h