mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
crimson/osd: add can_discard_op method for detecting "discardable" client requests
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
This commit is contained in:
parent
e9ac113f4f
commit
2c17bc1933
@ -69,9 +69,7 @@ seastar::future<> ClientRequest::start()
|
||||
return with_blocking_future(osd.wait_for_pg(m->get_spg()));
|
||||
}).then([this, opref](Ref<PG> pgref) {
|
||||
PG &pg = *pgref;
|
||||
if (__builtin_expect(m->get_map_epoch()
|
||||
< pg.get_info().history.same_primary_since,
|
||||
false)) {
|
||||
if (pg.can_discard_op(*m)) {
|
||||
return osd.send_incremental_map(conn.get(), m->get_map_epoch());
|
||||
}
|
||||
return with_blocking_future(
|
||||
|
@ -993,4 +993,9 @@ void PG::on_change(ceph::os::Transaction &t) {
|
||||
backend->on_actingset_changed({ is_primary() });
|
||||
}
|
||||
|
||||
bool PG::can_discard_op(const MOSDOp& m) const {
|
||||
return __builtin_expect(m.get_map_epoch()
|
||||
< peering_state.get_info().history.same_primary_since, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -672,6 +672,7 @@ private:
|
||||
|
||||
template <typename MsgType>
|
||||
bool can_discard_replica_op(const MsgType& m) const;
|
||||
bool can_discard_op(const MOSDOp& m) const;
|
||||
bool is_missing_object(const hobject_t& soid) const {
|
||||
return peering_state.get_pg_log().get_missing().get_items().count(soid);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user