From: Sage Weil Date: Thu, 18 Jul 2013 21:35:19 +0000 (-0700) Subject: mon: decline to scrub when paxos is not active X-Git-Tag: v0.61.6~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a0cb40b45c4f2f921a63c2d7bb5a28572381d793;p=ceph.git mon: decline to scrub when paxos is not active In f1ce8d7c955a2443111bf7d9e16b4c563d445712 we close a race between scrub and paxos commit completion on the leader. The fix is nontrivial to backport and probably not worthwhile; just avoid scrubbing at that time for now. Note that the actual fix for this is in commit f1ce8d7c955a2443111bf7d9e16b4c563d445712. Signed-off-by: Sage Weil --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index af00fe3279a..8d1ff16d500 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -4006,6 +4006,18 @@ int Monitor::scrub() return -EBUSY; } + if (!paxos->is_active()) { + /* + * There is a race between scrub and paxos wherein we commit on + * the leader when we get a majority of replies from quorum but we + * commit on the peons when the round finishes. This makes a + * well-timed scrub unhappy. The fix is non-trivial and won't be + * backported. Instead, just decline to scrub during that window. + */ + clog.info() << "paxos is not active; declining to scrub right now\n"; + return -EAGAIN; + } + scrub_result.clear(); scrub_version = paxos->get_version();