summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-06 21:38:56 -0700
committerGreg Farnum <greg@inktank.com>2013-10-09 13:31:36 -0700
commit4cdfabb58f0ac41ae7da33b4d358e5ba0dcee85e (patch)
treed183f7dd338ed53af97f020ba15999234409d67c
parentd783e33b672ec324eb48d588f956da0c51ff5dac (diff)
downloadceph-4cdfabb58f0ac41ae7da33b4d358e5ba0dcee85e.tar.gz
mds: do not double-queue file recovery in eval_gather
This fixes a specific case of double-queuing seen in #4832: - client goes stale, inode marked NEEDSRECOVER - eval does sync, queued, -> RECOVERING - client resumes - client goes stale (again), inode marked NEEDSRECOVER - eval_gather queues *again* Note that a cursory look at the recovery code makes me think this needs a much more serious overhaul. In particular, I don't think we should be triggering recovery when transitioning *from* a stable state, but explicitly when we are flagged, or when gathering. We should probably also hold a wrlock over the recovery period and remove the force_wrlock kludge from the final size check. Opened ticket #5268. Signed-off-by: Sage Weil <sage@inktank.com> (cherry picked from commit a08d62045657713bf0a5372bf14136082ec3b17e) Reviewed-by: Greg Farnum <greg@inktank.com>
-rw-r--r--src/mds/Locker.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc
index c5ddb92d93e..fd46be09320 100644
--- a/src/mds/Locker.cc
+++ b/src/mds/Locker.cc
@@ -644,15 +644,14 @@ void Locker::eval_gather(SimpleLock *lock, bool first, bool *pneed_issue, list<C
if (lock->get_sm() == &sm_filelock) {
assert(in);
- if (in->state_test(CInode::STATE_NEEDSRECOVER)) {
+ if (in->state_test(CInode::STATE_RECOVERING)) {
+ dout(7) << "eval_gather finished gather, but still recovering" << dendl;
+ } else if (in->state_test(CInode::STATE_NEEDSRECOVER)) {
dout(7) << "eval_gather finished gather, but need to recover" << dendl;
mds->mdcache->queue_file_recover(in);
mds->mdcache->do_file_recover();
}
- if (in->state_test(CInode::STATE_RECOVERING)) {
- dout(7) << "eval_gather finished gather, but still recovering" << dendl;
- return;
- }
+ return;
}
if (!lock->get_parent()->is_auth()) {