From: Ronen Friedman Date: Sat, 4 Oct 2025 16:58:40 +0000 (-0500) Subject: osd/scrub: scanning the rollbacks not mandating a reschedule X-Git-Tag: testing/wip-vshankar-testing-20260219.125903~6^2~13^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9cccb68f5b92b0955d19e694bf89bb1cb6dd1c9d;p=ceph-ci.git osd/scrub: scanning the rollbacks not mandating a reschedule The scrubber calls PG::_scan_rollback_obs() to clean up obsolete rollback objects. This function may queue a transaction to delete such objects. The commit modifies the scrubber, so that no rescheduling of the scrub is mandated if no transaction was queued. Fixes: https://tracker.ceph.com/issues/73773 Signed-off-by: Ronen Friedman --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index fe1c51e7595..0c0e95c5597 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1743,7 +1743,7 @@ void PG::unreserve_recovery_space() { local_num_bytes.store(0); } -void PG::_scan_rollback_obs(const vector &rollback_obs) +bool PG::_scan_rollback_obs(const vector &rollback_obs) { ObjectStore::Transaction t; eversion_t trimmed_to = recovery_state.get_last_rollback_info_trimmed_to_applied(); @@ -1764,7 +1764,9 @@ void PG::_scan_rollback_obs(const vector &rollback_obs) derr << __func__ << ": queueing trans to clean up obsolete rollback objs" << dendl; osd->store->queue_transaction(ch, std::move(t), NULL); + return true; // a transaction was queued } + return false; } diff --git a/src/osd/PG.h b/src/osd/PG.h index faacab79250..43795697fd1 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1228,7 +1228,15 @@ protected: [[nodiscard]] bool ops_blocked_by_scrub() const; [[nodiscard]] Scrub::scrub_prio_t is_scrub_blocking_ops() const; - void _scan_rollback_obs(const std::vector &rollback_obs); + + /** + * Scan the given list of rollback objects for obsolete entries. + * If found - the obsolete entries are removed. + * + * @return 'true' if a transaction was issued. + */ + bool _scan_rollback_obs(const std::vector &rollback_obs); + /** * returns true if [begin, end) is good to scrub at this time * a false return value obliges the implementer to requeue scrub when the diff --git a/src/osd/scrubber/pg_scrubber.cc b/src/osd/scrubber/pg_scrubber.cc index 243d18c1712..1d6b8898c92 100644 --- a/src/osd/scrubber/pg_scrubber.cc +++ b/src/osd/scrubber/pg_scrubber.cc @@ -1381,9 +1381,13 @@ int PgScrubber::build_scrub_map_chunk(ScrubMap& map, if (pos.ls.empty()) { break; } - m_pg->_scan_rollback_obs(rollback_obs); pos.pos = 0; - return -EINPROGRESS; + if (m_pg->_scan_rollback_obs(rollback_obs)) { + // we had to perform some real work (queue a transaction + // to discard obsolete rollback versions of objects in the + // selected range). Let's reschedule the scrub. + return -EINPROGRESS; + } } // scan objects