]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PrimaryLogPG: block obc for any inflight manifest ops
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 28 Aug 2019 06:38:42 +0000 (14:38 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 28 Aug 2019 10:08:07 +0000 (18:08 +0800)
otherwise it is likely to race with any follow-up scrubbing activities.
Note that it's ok for us to requeue_scrub before re-executing the op
since scrubbing will be blocking for the (same) global pg lock we
are currently holding.

Fixes: https://tracker.ceph.com/issues/41427
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/PrimaryLogPG.cc

index eb8cf3586688076d4cfec8cd4fba7d095d1a4ad3..c1a6b4b7689b88b1cca6d36c69d6b8c145cbd0a5 100644 (file)
@@ -3182,6 +3182,8 @@ public:
     : ctx(ctx), osd_op(osd_op) {}
   void finish(int r) override {
     // NB: caller must already have pg->lock held
+    ctx->obc->stop_block();
+    ctx->pg->kick_object_context_blocked(ctx->obc);
     if (r >= 0) {
       osd_op.rval = 0;
       ctx->pg->execute_ctx(ctx);
@@ -3287,6 +3289,7 @@ void PrimaryLogPG::refcount_manifest(ObjectContextRef obc, object_locator_t oloc
     flags, c);
   if (cb) {
     manifest_ops[obc->obs.oi.soid] = std::make_shared<ManifestOp>(cb, tid);
+    obc->start_block();
   }
 }