backfill_state().peer_backfill_info);
primary_bi.pop_front();
}
+ backfill_listener().maybe_flush();
}
if (should_rescan_primary(backfill_state().peer_backfill_info,
const hobject_t& obj,
const eversion_t& v) = 0;
+ virtual void maybe_flush() = 0;
+
virtual void update_peers_last_backfill(
const hobject_t& new_last_backfill) = 0;
const hobject_t& obj,
const eversion_t& v)
{
- ceph_abort_msg("Not implemented");
+ // allocate a pair if target is seen for the first time
+ auto& req = backfill_drop_requests[target];
+ if (!req) {
+ req = ceph::make_message<MOSDPGBackfillRemove>(
+ spg_t(pg->get_pgid().pgid, target.shard), pg->get_osdmap_epoch());
+ }
+ req->ls.emplace_back(obj, v);
+}
+
+void PGRecovery::maybe_flush()
+{
+ for (auto& [target, req] : backfill_drop_requests) {
+ std::ignore = pg->get_shard_services().send_to_osd(
+ target.osd,
+ std::move(req),
+ pg->get_osdmap_epoch());
+ }
+ backfill_drop_requests.clear();
}
void PGRecovery::update_peers_last_backfill(
#include "osd/object_state.h"
+class MOSDPGBackfillRemove;
class PGBackend;
class PGRecovery : public crimson::osd::BackfillState::BackfillListener {
// backfill begin
std::unique_ptr<crimson::osd::BackfillState> backfill_state;
+ std::map<pg_shard_t,
+ ceph::ref_t<MOSDPGBackfillRemove>> backfill_drop_requests;
template <class EventT>
void start_backfill_recovery(
const pg_shard_t& target,
const hobject_t& obj,
const eversion_t& v) final;
+ void maybe_flush() final;
void update_peers_last_backfill(
const hobject_t& new_last_backfill) final;
bool budget_available() const final;
const hobject_t& obj,
const eversion_t& v) override;
+ void maybe_flush() override;
+
void update_peers_last_backfill(
const hobject_t& new_last_backfill) override;
backfill_targets.at(target).store.drop(obj, v);
}
+void BackfillFixture::maybe_flush()
+{
+}
+
void BackfillFixture::update_peers_last_backfill(
const hobject_t& new_last_backfill)
{