From 8221a2a54dc04fa65757c2e95e89404d76859a1e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 5 Jan 2014 17:44:49 -0800 Subject: [PATCH] osd/ReplicatedPG: cleanly abort flush if the object no longer exists If the object no longer exists (for example, because the snap trimmer just killed it) clean up the flush state without trying to mark the object clean. Signed-off-by: Sage Weil --- src/osd/ReplicatedPG.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 208f6d3e47579..3d4531a69f152 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5489,10 +5489,15 @@ int ReplicatedPG::try_flush_mark_clean(FlushOpRef fop) ObjectContextRef obc = fop->ctx->obc; const hobject_t& oid = obc->obs.oi.soid; - if (fop->flushed_version != obc->obs.oi.user_version) { - dout(10) << __func__ << " flushed_version " << fop->flushed_version - << " != current " << obc->obs.oi.user_version - << dendl; + if (fop->flushed_version != obc->obs.oi.user_version || + !obc->obs.exists) { + if (obc->obs.exists) + dout(10) << __func__ << " flushed_version " << fop->flushed_version + << " != current " << obc->obs.oi.user_version + << dendl; + else + dout(10) << __func__ << " object no longer exists" << dendl; + if (!fop->dup_ops.empty()) { dout(20) << __func__ << " requeueing dups" << dendl; requeue_ops(fop->dup_ops); -- 2.39.5