]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: decline to scrub when paxos is not active
authorSage Weil <sage@inktank.com>
Thu, 18 Jul 2013 21:35:19 +0000 (14:35 -0700)
committerSage Weil <sage@inktank.com>
Fri, 19 Jul 2013 01:12:16 +0000 (18:12 -0700)
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 <sage@inktank.com>
src/mon/Monitor.cc

index af00fe3279a56200e0f4c5f9608498ec817be4e1..8d1ff16d5009e9412be5ef22ba8415439621d17d 100644 (file)
@@ -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();