]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: cleanly abort flush if the object no longer exists
authorSage Weil <sage@inktank.com>
Mon, 6 Jan 2014 01:44:49 +0000 (17:44 -0800)
committerSage Weil <sage@inktank.com>
Tue, 14 Jan 2014 00:19:49 +0000 (16:19 -0800)
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 <sage@inktank.com>
src/osd/ReplicatedPG.cc

index 208f6d3e47579f0553ec70f83f791f70e1d30266..3d4531a69f152b7d016fc6aaf6998651edd7f109 100644 (file)
@@ -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);