]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/pg: start_operation for read_state, schedule_event_on_commit 28771/head
authorSamuel Just <sjust@redhat.com>
Thu, 27 Jun 2019 18:57:22 +0000 (11:57 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 27 Jun 2019 19:38:17 +0000 (12:38 -0700)
This way they'll be holding the appropriate pipeline stage.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/pg.cc
src/crimson/osd/pg.h

index 64d6fc3e62ad5260dea5390947f41d2116b0cc3e..d4c25aedcc290dc3370c956e2b21ab8e7ddf176c 100644 (file)
@@ -221,13 +221,15 @@ seastar::future<> PG::read_state(ceph::os::FuturizedStore* store)
       else
        peering_state.set_role(-1);
 
-      PeeringCtx rctx;
-      PeeringState::Initialize evt;
-      peering_state.handle_event(evt, &rctx);
-      peering_state.write_if_dirty(rctx.transaction);
-      store->do_transaction(
-       coll_ref,
-       std::move(rctx.transaction));
+      epoch_t epoch = peering_state.get_osdmap()->get_epoch();
+      shard_services.start_operation<LocalPeeringEvent>(
+       this,
+       shard_services,
+       pg_whoami,
+       pgid,
+       epoch,
+       epoch,
+       PeeringState::Initialize());
 
       return seastar::now();
     });
index 7fee356614546294470e6f06eba1225d466212e7..6639dc9bcf0c8edac4f4d156c912073a647c05fe 100644 (file)
@@ -205,11 +205,15 @@ public:
     ObjectStore::Transaction &t,
     PGPeeringEventRef on_commit) final {
     t.register_on_commit(
-      new LambdaContext([this, on_commit](){
-       PeeringCtx rctx;
-        do_peering_event(*on_commit, rctx);
-       shard_services.dispatch_context(std::move(rctx));
-    }));
+      new LambdaContext(
+       [this, on_commit=std::move(on_commit)] {
+         shard_services.start_operation<LocalPeeringEvent>(
+           this,
+           shard_services,
+           pg_whoami,
+           pgid,
+           std::move(*on_commit));
+       }));
   }
 
   void update_heartbeat_peers(set<int> peers) final {