]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: reset new_obs and new_snapset in execute_ctx
authorSamuel Just <sam.just@inktank.com>
Fri, 25 Oct 2013 01:52:59 +0000 (18:52 -0700)
committerSamuel Just <sam.just@inktank.com>
Mon, 28 Oct 2013 20:30:42 +0000 (13:30 -0700)
This way, if execute_ctx is rerun on the same OpContext, we
won't erroneously reuse a stale snapset/object_info.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index 450b377288fb26a2bc5b548afbd93de4b6b189a1..fc9ce53d27d0cac4e42262d2541ad4341b874761 100644 (file)
@@ -1203,6 +1203,7 @@ void ReplicatedPG::do_cache_redirect(OpRequestRef op, ObjectContextRef obc)
 void ReplicatedPG::execute_ctx(OpContext *ctx)
 {
   dout(10) << __func__ << " " << ctx << dendl;
+  ctx->reset_obs(ctx->obc);
   OpRequestRef op = ctx->op;
   MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
   ObjectContextRef obc = ctx->obc;
index f36138079a0b524b3b39ee4282cdb2941ffb7386..e897925f091be012e74ba160c875f97a56e53b6f 100644 (file)
@@ -403,6 +403,13 @@ public:
        snapset = &_ssc->snapset;
       }
     }
+    void reset_obs(ObjectContextRef obc) {
+      new_obs = ObjectState(obc->obs.oi, obc->obs.exists);
+      if (obc->ssc) {
+       new_snapset = obc->ssc->snapset;
+       snapset = &obc->ssc->snapset;
+      }
+    }
     ~OpContext() {
       assert(!clone_obc);
       assert(lock_to_release == NONE);