mirror of
https://github.com/ceph/ceph
synced 2025-01-20 01:51:34 +00:00
crimson/osd: extract with_sequencer() method out
because we should only ensure the ordering of the requests touching the objects, the other requests like pgls should not be ordered along with them, so as the first step, let's extract with_sequencer() method out, so we can differentiate these two cases with minimal repeatings. Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
57aefd9250
commit
1a44046339
@ -87,12 +87,8 @@ seastar::future<> ClientRequest::start()
|
|||||||
return interruptor::with_interruption([this, pgref]() mutable {
|
return interruptor::with_interruption([this, pgref]() mutable {
|
||||||
epoch_t same_interval_since = pgref->get_interval_start_epoch();
|
epoch_t same_interval_since = pgref->get_interval_start_epoch();
|
||||||
logger().debug("{} same_interval_since: {}", *this, same_interval_since);
|
logger().debug("{} same_interval_since: {}", *this, same_interval_since);
|
||||||
may_set_prev_op();
|
return with_sequencer(
|
||||||
return sequencer.start_op(
|
interruptor::wrap_function([this, pgref]() -> interruptible_future<> {
|
||||||
*this,
|
|
||||||
handle,
|
|
||||||
interruptor::wrap_function(
|
|
||||||
[this, pgref]() mutable -> interruptible_future<> {
|
|
||||||
PG &pg = *pgref;
|
PG &pg = *pgref;
|
||||||
if (pg.can_discard_op(*m)) {
|
if (pg.can_discard_op(*m)) {
|
||||||
return osd.send_incremental_map(conn, m->get_map_epoch());
|
return osd.send_incremental_map(conn, m->get_map_epoch());
|
||||||
@ -119,8 +115,7 @@ seastar::future<> ClientRequest::start()
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
).then_interruptible([this, pgref]() {
|
).then_interruptible([pgref]() {
|
||||||
sequencer.finish_op(*this);
|
|
||||||
return seastar::stop_iteration::yes;
|
return seastar::stop_iteration::yes;
|
||||||
});
|
});
|
||||||
}, [this, pgref](std::exception_ptr eptr) {
|
}, [this, pgref](std::exception_ptr eptr) {
|
||||||
|
@ -63,6 +63,14 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
template <typename FuncT>
|
||||||
|
interruptible_future<> with_sequencer(FuncT&& func) {
|
||||||
|
may_set_prev_op();
|
||||||
|
return sequencer.start_op(*this, handle, std::forward<FuncT>(func))
|
||||||
|
.then_interruptible([this] {
|
||||||
|
sequencer.finish_op(*this);
|
||||||
|
});
|
||||||
|
}
|
||||||
interruptible_future<> do_process(
|
interruptible_future<> do_process(
|
||||||
Ref<PG>& pg,
|
Ref<PG>& pg,
|
||||||
crimson::osd::ObjectContextRef obc);
|
crimson::osd::ObjectContextRef obc);
|
||||||
|
Loading…
Reference in New Issue
Block a user