]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedBackend: do applied work synchronously
authorSage Weil <sage@redhat.com>
Sat, 27 Jan 2018 21:14:47 +0000 (15:14 -0600)
committerSage Weil <sage@redhat.com>
Mon, 12 Feb 2018 20:35:27 +0000 (14:35 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ReplicatedBackend.cc

index 2e14f1e5151359ea222fbb52c719586b1e049160..2d79b61d1d353f4b52cbfb0bb5b14681e20a5ef0 100644 (file)
@@ -59,16 +59,6 @@ class PG_RecoveryQueueAsync : public Context {
 };
 }
 
-struct ReplicatedBackend::C_OSD_RepModifyApply : public Context {
-  ReplicatedBackend *pg;
-  RepModifyRef rm;
-  C_OSD_RepModifyApply(ReplicatedBackend *pg, RepModifyRef r)
-    : pg(pg), rm(r) {}
-  void finish(int r) override {
-    pg->repop_applied(rm);
-  }
-};
-
 struct ReplicatedBackend::C_OSD_RepModifyCommit : public Context {
   ReplicatedBackend *pg;
   RepModifyRef rm;
@@ -284,17 +274,6 @@ public:
   }
 };
 
-class C_OSD_OnOpApplied : public Context {
-  ReplicatedBackend *pg;
-  ReplicatedBackend::InProgressOp *op;
-public:
-  C_OSD_OnOpApplied(ReplicatedBackend *pg, ReplicatedBackend::InProgressOp *op) 
-    : pg(pg), op(op) {}
-  void finish(int) override {
-    pg->op_applied(op);
-  }
-};
-
 void generate_transaction(
   PGTransactionUPtr &pgt,
   const coll_t &coll,
@@ -516,9 +495,6 @@ void ReplicatedBackend::submit_transaction(
     true,
     op_t);
   
-  op_t.register_on_applied(
-    parent->bless_context(
-      new C_OSD_OnOpApplied(this, &op)));
   op_t.register_on_commit(
     parent->bless_context(
       new C_OSD_OnOpCommit(this, &op)));
@@ -527,6 +503,7 @@ void ReplicatedBackend::submit_transaction(
   tls.push_back(std::move(op_t));
 
   parent->queue_transactions(tls, op.op);
+  op_applied(&op);
 }
 
 void ReplicatedBackend::op_applied(
@@ -1139,14 +1116,12 @@ void ReplicatedBackend::do_repop(OpRequestRef op)
   rm->opt.register_on_commit(
     parent->bless_context(
       new C_OSD_RepModifyCommit(this, rm)));
-  rm->localt.register_on_applied(
-    parent->bless_context(
-      new C_OSD_RepModifyApply(this, rm)));
   vector<ObjectStore::Transaction> tls;
   tls.reserve(2);
   tls.push_back(std::move(rm->localt));
   tls.push_back(std::move(rm->opt));
   parent->queue_transactions(tls, op);
+  repop_applied(rm);
   // op is cleaned up by oncommit/onapply when both are executed
 }