]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: check is_dup earlier; do not set osdop version if it's a noop
authorSage Weil <sage@newdream.net>
Fri, 9 Oct 2009 17:53:37 +0000 (10:53 -0700)
committerSage Weil <sage@newdream.net>
Fri, 9 Oct 2009 17:53:37 +0000 (10:53 -0700)
Otherwise, we end up with a bogus version that's not logged and in the
future, which confuses us later (we think it's a replay or something).  If
it's a noop, that means the version is either already set, or doesn't need
to be.

src/osd/ReplicatedPG.cc

index b095c8ac9e938addff3b37362e597d7bfbb9b22a..fb4c58ab03d5c16cd557c14d674ceb8d866207fb 100644 (file)
@@ -534,6 +534,11 @@ void ReplicatedPG::do_op(MOSDOp *op)
       return;
     }
 
+    if (is_dup(ctx->reqid)) {
+      dout(3) << "do_op dup " << ctx->reqid << ", doing WRNOOP" << dendl;
+      noop = true;
+    }
+
     // version
     ctx->at_version = log.head;
     if (!noop) {
@@ -541,23 +546,18 @@ void ReplicatedPG::do_op(MOSDOp *op)
       ctx->at_version.version++;
       assert(ctx->at_version > info.last_update);
       assert(ctx->at_version > log.head);
+
+      // set version in op, for benefit of client and our eventual reply.  if !noop!
+      op->set_version(ctx->at_version);
     }
 
     ctx->mtime = op->get_mtime();
     
-    // set version in op, for benefit of client and our eventual reply
-    op->set_version(ctx->at_version);
-
     dout(10) << "do_op " << soid << " " << ctx->ops
             << " ov " << obc->obs.oi.version << " av " << ctx->at_version 
             << " snapc " << ctx->snapc
             << " snapset " << obc->obs.ssc->snapset
             << dendl;  
-
-    if (is_dup(ctx->reqid)) {
-      dout(3) << "do_op dup " << ctx->reqid << ", doing WRNOOP" << dendl;
-      noop = true;
-    }
   } else {
     dout(10) << "do_op " << soid << " " << ctx->ops
             << " ov " << obc->obs.oi.version