logger().debug("{}: {} already trimming.", *this, __func__);
return;
}
+ // Temporary: defer snap trimming while scrubbing, until the full scrub
+ // scheduling code (including is_scrub_queued_or_active()) is merged.
+ // (mark https://tracker.ceph.com/issues/76428 as solved once fixed).
+ if (peering_state.state_test(PG_STATE_SCRUBBING)) {
+ logger().info("{}: {} scrubbing, deferring snap trim", *this, __func__);
+ return;
+ }
// loops until snap_trimq is empty or SNAPTRIM_ERROR.
Ref<PG> pg_ref = this;
std::ignore = interruptor::with_interruption([this] {
}
}
+void PG::kick_snap_trim()
+{
+ if (peering_state.is_active() && peering_state.is_clean()
+ && !snap_trimq.empty()
+ && !peering_state.state_test(PG_STATE_SNAPTRIM)) {
+ logger().info("{}: scrub complete, retriggering snap trim", *this);
+ on_active_actmap();
+ }
+}
+
void PG::on_active_advmap(const OSDMapRef &osdmap)
{
const auto new_removed_snaps = osdmap->get_new_removed_snaps();
interruptible_future<seastar::stop_iteration> trim_snap(
snapid_t to_trim,
bool needs_pause);
+ /// Re-trigger snap trimming after scrub completion. Snap trimming is
+ /// deferred while the PG is scrubbing; call this from notify_scrub_end()
+ /// to resume.
+ void kick_snap_trim();
private:
PG_OSDMapGate osdmap_gate;