]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: block requests on object during COPY_FROM
authorSage Weil <sage@inktank.com>
Wed, 11 Sep 2013 22:09:59 +0000 (15:09 -0700)
committerSage Weil <sage@inktank.com>
Tue, 17 Sep 2013 18:06:27 +0000 (11:06 -0700)
Block any request on an object (read or write) during the COPY_FROM
operation.

This could potentially be broken down into read vs write operations without
much difficulty, but blocking any op indescriminately is sufficient for
now, so let's keep it simple.

Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/ReplicatedPG.cc
src/osd/osd_types.h

index c9f4cb624deabe2daaf49e271409b22cfd5ffaa5..ca747db90c61a10a380175aa54ede312ef84fca3 100644 (file)
@@ -4170,6 +4170,7 @@ void ReplicatedPG::process_copy_chunk(hobject_t oid, tid_t tid, int r)
   if (r < 0) {
     copy_ops.erase(ctx->obc->obs.oi.soid);
     --ctx->obc->copyfrom_readside;
+    kick_object_context_blocked(ctx->obc);
     reply_ctx(ctx, r);
     return;
   }
@@ -4207,6 +4208,7 @@ void ReplicatedPG::process_copy_chunk(hobject_t oid, tid_t tid, int r)
   copy_ops.erase(ctx->obc->obs.oi.soid);
   --ctx->obc->copyfrom_readside;
   ctx->copy_op.reset();
+  kick_object_context_blocked(ctx->obc);
 }
 
 void ReplicatedPG::_write_copy_chunk(CopyOpRef cop, ObjectStore::Transaction *t)
@@ -4292,6 +4294,8 @@ void ReplicatedPG::cancel_copy(CopyOpRef cop)
   --ctx->obc->copyfrom_readside;
   ctx->copy_op.reset();
 
+  kick_object_context_blocked(ctx->obc);
+
   delete ctx;
 }
 
index 45937a91dd898e50a9cca75777630aa9e891d6a9..626848bbdf4bd5d0530ba47535322ffe6b03dcee 100644 (file)
@@ -2153,7 +2153,7 @@ public:
   }
 
   bool is_blocked() const {
-    return false;
+    return copyfrom_readside > 0;
   }
 
   // do simple synchronous mutual exclusion, for now.  now waitqueues or anything fancy.