IRef ref = this;
return with_blocking_future(
handle.enter(pg->peering_request_pg_pipeline.process))
- .then([this] {
- if (do_init) {
- pg->handle_initialize(rctx);
- pg->handle_activate_map(rctx);
- }
- return seastar::do_for_each(
- boost::make_counting_iterator(from + 1),
- boost::make_counting_iterator(to + 1),
- [this](epoch_t next_epoch) {
- return osd.get_map(next_epoch).then(
- [this] (cached_map_t&& next_map) {
- pg->handle_advance_map(next_map, rctx);
- });
- }).then([this] {
- pg->handle_activate_map(rctx);
- handle.exit();
- if (do_init) {
- osd.pg_map.pg_created(pg->get_pgid(), pg);
- osd.shard_services.inc_pg_num();
- logger().info("PGAdvanceMap::start new pg {}", *pg);
- }
- return seastar::when_all_succeed(
- pg->get_need_up_thru() \
- ? osd.shard_services.send_alive(pg->get_same_interval_since())
- : seastar::now(),
- osd.shard_services.dispatch_context(
- pg->get_collection_ref(),
- std::move(rctx)));
- }).then_unpack([this] {
- return osd.shard_services.send_pg_temp();
- });
- }).then([this, ref=std::move(ref)] {
- logger().debug("{}: complete", *this);
- });
+ .then([this] {
+ if (do_init) {
+ pg->handle_initialize(rctx);
+ pg->handle_activate_map(rctx);
+ }
+ return seastar::do_for_each(
+ boost::make_counting_iterator(from + 1),
+ boost::make_counting_iterator(to + 1),
+ [this](epoch_t next_epoch) {
+ return osd.get_map(next_epoch).then(
+ [this] (cached_map_t&& next_map) {
+ pg->handle_advance_map(next_map, rctx);
+ });
+ }).then([this] {
+ pg->handle_activate_map(rctx);
+ handle.exit();
+ if (do_init) {
+ osd.pg_map.pg_created(pg->get_pgid(), pg);
+ osd.shard_services.inc_pg_num();
+ logger().info("PGAdvanceMap::start new pg {}", *pg);
+ }
+ return seastar::when_all_succeed(
+ pg->get_need_up_thru() \
+ ? osd.shard_services.send_alive(pg->get_same_interval_since())
+ : seastar::now(),
+ osd.shard_services.dispatch_context(
+ pg->get_collection_ref(),
+ std::move(rctx)));
+ }).then_unpack([this] {
+ return osd.shard_services.send_pg_temp();
+ });
+ }).then([this, ref=std::move(ref)] {
+ logger().debug("{}: complete", *this);
+ });
}
}