From a0cb40b45c4f2f921a63c2d7bb5a28572381d793 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 18 Jul 2013 14:35:19 -0700 Subject: [PATCH] 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 --- src/mon/Monitor.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index af00fe3279a56..8d1ff16d5009e 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(); -- 2.39.5