}
}
-bool PG::should_send_op(pg_shard_t peer, const hobject_t &hoid)
-{
- if (peer == get_primary()) {
- return true;
- }
- bool should_send =
- hoid.pool != (int64_t)get_pgid().pool() ||
- hoid <= peering_state.get_peer_info(peer).last_backfill ||
- (recovery_handler->backfill_state &&
- hoid <= recovery_handler->backfill_state->get_last_backfill_started());
- if (!should_send) {
- ceph_assert(is_backfill_target(peer));
- logger().debug("{}: {} shipping empty opt to osd.{}, object {}"
- " beyond std::max(last_backfill_started,"
- " peer_info[peer].last_backfill {})",
- *this, __func__, peer, hoid,
- peering_state.get_peer_info(peer).last_backfill);
- return should_send;
- }
- if (peering_state.is_async_recovery_target(peer) &&
- peering_state.get_peer_missing(peer).is_missing(hoid)) {
- should_send = false;
- logger().info("{}: {} shipping empty opt to osd.{}, object {}"
- " which is pending recovery in async_recovery_targets",
- *this, __func__, peer, hoid);
- }
- return should_send;
-}
unsigned PG::get_target_pg_log_entries() const
{
const unsigned local_num_pgs = shard_services.get_num_local_pgs();
bool PG::should_send_op(
pg_shard_t peer,
- const hobject_t &hoid) const
+ const hobject_t &hoid)
{
if (peer == get_primary())
return true;
bool should_send =
(hoid.pool != (int64_t)get_info().pgid.pool() ||
- // An object has been fully pushed to the backfill target if and only if
- // either of the following conditions is met:
- // 1. peer_info.last_backfill has passed "hoid"
- // 2. last_backfill_started has passed "hoid" and "hoid" is not in the peer
- // missing set
- hoid <= peering_state.get_peer_info(peer).last_backfill ||
- (has_backfill_state() && hoid <= get_last_backfill_started() &&
- !is_missing_on_peer(peer, hoid)));
- if (!should_send) {
- ceph_assert(is_backfill_target(peer));
- logger().debug("{} issue_repop shipping empty opt to osd."
- "{}, object {} beyond std::max(last_backfill_started, "
- "peer_info[peer].last_backfill {})",
- __func__, peer, hoid,
- peering_state.get_peer_info(peer).last_backfill);
+ // An object has been fully pushed to the backfill target if and only if
+ // hoid is not in the peer's missing set and either of the following
+ // conditions is met:
+ // 1. peer_info.last_backfill has passed "hoid"
+ // 2. last_backfill_started has passed "hoid"
+ hoid <= peering_state.get_peer_info(peer).last_backfill ||
+ (has_backfill_state() && hoid <= get_last_backfill_started())) &&
+ !is_missing_on_peer(peer, hoid);
+ if (unlikely(!should_send)) {
+ if (peering_state.is_async_recovery_target(peer)) {
+ logger().info("{}: {} shipping empty opt to osd.{}, object {}"
+ " which is pending recovery in async_recovery_targets",
+ *this, __func__, peer, hoid);
+ } else {
+ ceph_assert(is_backfill_target(peer));
+ logger().debug("{} issue_repop shipping empty opt to osd."
+ "{}, object {} beyond std::max(last_backfill_started, "
+ "peer_info[peer].last_backfill {})",
+ __func__, peer, hoid,
+ peering_state.get_peer_info(peer).last_backfill);
+ }
}
return should_send;
- // TODO: should consider async recovery cases in the future which are not supported
- // by crimson yet
}
void PG::op_applied(const eversion_t &applied_version)