mirror of
https://github.com/ceph/ceph
synced 2024-12-27 14:03:25 +00:00
Merge pull request #28771 from athanatos/sjust/wip-schedule-event-on-commit
crimson/osd/pg: start_operation for read_state, schedule_event_on_commit Reviewed-by: Yingxin Cheng <yingxincheng@gmail.com> Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
commit
4987bea98c
@ -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();
|
||||
});
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user