]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/scrub: scanning the rollbacks not mandating a reschedule
authorRonen Friedman <rfriedma@redhat.com>
Sat, 4 Oct 2025 16:58:40 +0000 (11:58 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Mon, 10 Nov 2025 15:09:19 +0000 (09:09 -0600)
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 <rfriedma@redhat.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/scrubber/pg_scrubber.cc

index fe1c51e7595b1aa92ee5ed0274cafd43413bc646..0c0e95c559723996dd000281086ab3444131345a 100644 (file)
@@ -1743,7 +1743,7 @@ void PG::unreserve_recovery_space() {
   local_num_bytes.store(0);
 }
 
-void PG::_scan_rollback_obs(const vector<ghobject_t> &rollback_obs)
+bool PG::_scan_rollback_obs(const vector<ghobject_t> &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<ghobject_t> &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;
 }
 
 
index faacab7925009ecc79d992e81a732f7207b005d3..43795697fd169874d11849a982590535e1922c99 100644 (file)
@@ -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<ghobject_t> &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<ghobject_t> &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
index 243d18c1712524624713925efad35c6563854977..1d6b8898c92b5ce745f8bf41f338af0629ca93fc 100644 (file)
@@ -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