PGActivationBlocker::BlockingEvent::Backend,
scrub::PGScrubber::BlockingEvent::Backend,
ClientRequest::PGPipeline::RecoverMissing::BlockingEvent::Backend,
+ ClientRequest::PGPipeline::RecoverMissingLockOBC::BlockingEvent::Backend,
+ ClientRequest::PGPipeline::RecoverMissingLockOBC::
+ BlockingEvent::ExitBarrierEvent::Backend,
+ ClientRequest::PGPipeline::RecoverMissingSnaps::BlockingEvent::Backend,
ClientRequest::PGPipeline::GetOBC::BlockingEvent::Backend,
ClientRequest::PGPipeline::Process::BlockingEvent::Backend,
ClientRequest::PGPipeline::WaitRepop::BlockingEvent::Backend,
const ClientRequest::PGPipeline::RecoverMissing& blocker) override {
}
+ void handle(ClientRequest::PGPipeline::RecoverMissingLockOBC::BlockingEvent& ev,
+ const Operation& op,
+ const ClientRequest::PGPipeline::RecoverMissingLockOBC& blocker) override {
+ }
+
+ void handle(ClientRequest::PGPipeline::RecoverMissingLockOBC::
+ BlockingEvent::ExitBarrierEvent& ev,
+ const Operation& op) override {
+ }
+
+ void handle(ClientRequest::PGPipeline::RecoverMissingSnaps::BlockingEvent& ev,
+ const Operation& op,
+ const ClientRequest::PGPipeline::RecoverMissingSnaps& blocker) override {
+ }
+
void handle(ClientRequest::PGPipeline::GetOBC::BlockingEvent& ev,
const Operation& op,
const ClientRequest::PGPipeline::GetOBC& blocker) override {
PGActivationBlocker::BlockingEvent::Backend,
scrub::PGScrubber::BlockingEvent::Backend,
ClientRequest::PGPipeline::RecoverMissing::BlockingEvent::Backend,
+ ClientRequest::PGPipeline::RecoverMissingLockOBC::BlockingEvent::Backend,
+ ClientRequest::PGPipeline::RecoverMissingLockOBC::
+ BlockingEvent::ExitBarrierEvent::Backend,
+ ClientRequest::PGPipeline::RecoverMissingSnaps::BlockingEvent::Backend,
ClientRequest::PGPipeline::GetOBC::BlockingEvent::Backend,
ClientRequest::PGPipeline::Process::BlockingEvent::Backend,
ClientRequest::PGPipeline::WaitRepop::BlockingEvent::Backend,
const ClientRequest::PGPipeline::RecoverMissing& blocker) override {
}
+ void handle(ClientRequest::PGPipeline::RecoverMissingLockOBC::BlockingEvent& ev,
+ const Operation& op,
+ const ClientRequest::PGPipeline::RecoverMissingLockOBC& blocker) override {
+ }
+
+ void handle(ClientRequest::PGPipeline::RecoverMissingLockOBC::
+ BlockingEvent::ExitBarrierEvent& ev,
+ const Operation& op) override {
+ }
+
+ void handle(ClientRequest::PGPipeline::RecoverMissingSnaps::BlockingEvent& ev,
+ const Operation& op,
+ const ClientRequest::PGPipeline::RecoverMissingSnaps& blocker) override {
+ }
+
void handle(ClientRequest::PGPipeline::GetOBC::BlockingEvent& ev,
const Operation& op,
const ClientRequest::PGPipeline::GetOBC& blocker) override {
get_foreign_connection().send_with_throttling(std::move(reply)));
}
+ClientRequest::interruptible_future<>
+ClientRequest::recover_missing_snaps(
+ Ref<PG> pg,
+ instance_handle_t &ihref,
+ ObjectContextRef head,
+ std::set<snapid_t> &snaps)
+{
+ co_await ihref.enter_stage<interruptor>(
+ client_pp(*pg).recover_missing_snaps, *this);
+ for (auto &snap : snaps) {
+ auto coid = head->obs.oi.soid;
+ coid.snap = snap;
+ auto oid = resolve_oid(head->get_head_ss(), coid);
+ /* Rollback targets may legitimately not exist if, for instance,
+ * the object is an rbd block which happened to be sparse and
+ * therefore non-existent at the time of the specified snapshot.
+ * In such a case, rollback will simply delete the object. Here,
+ * we skip the oid as there is no corresponding clone to recover.
+ * See https://tracker.ceph.com/issues/63821 */
+ if (oid) {
+ co_await do_recover_missing(pg, *oid, m->get_reqid());
+ }
+ }
+}
+
ClientRequest::interruptible_future<>
ClientRequest::process_op(
instance_handle_t &ihref, Ref<PG> pg, unsigned this_instance_id)
co_await do_recover_missing(pg, m->get_hobj().get_head(), m->get_reqid());
std::set<snapid_t> snaps = snaps_need_to_recover();
if (!snaps.empty()) {
+ // call with_obc() in order, but wait concurrently for loading.
+ ihref.enter_stage_sync(
+ client_pp(*pg).recover_missing_lock_obc, *this);
auto with_obc = pg->obc_loader.with_obc<RWState::RWREAD>(
m->get_hobj().get_head(),
- [&snaps, pg, this](auto head, auto) {
- return InterruptibleOperation::interruptor::do_for_each(
- snaps,
- [head, pg, this](auto &snap)
- -> InterruptibleOperation::template interruptible_future<> {
- auto coid = head->obs.oi.soid;
- coid.snap = snap;
- auto oid = resolve_oid(head->get_head_ss(), coid);
- /* Rollback targets may legitimately not exist if, for instance,
- * the object is an rbd block which happened to be sparse and
- * therefore non-existent at the time of the specified snapshot.
- * In such a case, rollback will simply delete the object. Here,
- * we skip the oid as there is no corresponding clone to recover.
- * See https://tracker.ceph.com/issues/63821 */
- if (oid) {
- return do_recover_missing(pg, *oid, m->get_reqid());
- } else {
- return seastar::now();
- }
- });
+ [&snaps, &ihref, pg, this](auto head, auto) {
+ return recover_missing_snaps(pg, ihref, head, snaps);
}).handle_error_interruptible(
crimson::ct_error::assert_all("unexpected error")
);
public:
class PGPipeline : public CommonPGPipeline {
public:
+ struct RecoverMissingLockOBC : OrderedConcurrentPhaseT<RecoverMissingLockOBC> {
+ static constexpr auto type_name = "ClientRequest::PGPipeline::recover_missing_lock_obc";
+ } recover_missing_lock_obc;
+ struct RecoverMissingSnaps : OrderedExclusivePhaseT<RecoverMissingSnaps> {
+ static constexpr auto type_name = "ClientRequest::PGPipeline::recover_missing_snaps";
+ } recover_missing_snaps;
struct AwaitMap : OrderedExclusivePhaseT<AwaitMap> {
static constexpr auto type_name = "ClientRequest::PGPipeline::await_map";
} await_map;
PGPipeline::WaitForActive::BlockingEvent,
PGActivationBlocker::BlockingEvent,
PGPipeline::RecoverMissing::BlockingEvent,
+ PGPipeline::RecoverMissingLockOBC::BlockingEvent,
+ PGPipeline::RecoverMissingSnaps::BlockingEvent,
scrub::PGScrubber::BlockingEvent,
PGPipeline::GetOBC::BlockingEvent,
PGPipeline::Process::BlockingEvent,
::crimson::interruptible::interruptible_future<
::crimson::osd::IOInterruptCondition> process_pg_op(
Ref<PG> pg);
+ interruptible_future<>
+ recover_missing_snaps(
+ Ref<PG> pg,
+ instance_handle_t &ihref,
+ ObjectContextRef head,
+ std::set<snapid_t> &snaps);
::crimson::interruptible::interruptible_future<
::crimson::osd::IOInterruptCondition> process_op(
instance_handle_t &ihref,
} wait_for_active;
struct RecoverMissing : OrderedExclusivePhaseT<RecoverMissing> {
static constexpr auto type_name = "CommonPGPipeline::recover_missing";
- } recover_missing, recover_missing2;
+ } recover_missing;
struct GetOBC : OrderedExclusivePhaseT<GetOBC> {
static constexpr auto type_name = "CommonPGPipeline::get_obc";
} get_obc;