File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -1743,7 +1743,7 @@ void PG::unreserve_recovery_space() {
17431743 local_num_bytes.store (0 );
17441744}
17451745
1746- void PG::_scan_rollback_obs (const vector<ghobject_t > &rollback_obs)
1746+ bool PG::_scan_rollback_obs (const vector<ghobject_t > &rollback_obs)
17471747{
17481748 ObjectStore::Transaction t;
17491749 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)
17641764 derr << __func__ << " : queueing trans to clean up obsolete rollback objs"
17651765 << dendl;
17661766 osd->store ->queue_transaction (ch, std::move (t), NULL );
1767+ return true ; // a transaction was queued
17671768 }
1769+ return false ;
17681770}
17691771
17701772
Original file line number Diff line number Diff line change @@ -1228,7 +1228,15 @@ class PG : public DoutPrefixProvider,
12281228 [[nodiscard]] bool ops_blocked_by_scrub () const ;
12291229 [[nodiscard]] Scrub::scrub_prio_t is_scrub_blocking_ops () const ;
12301230
1231- void _scan_rollback_obs (const std::vector<ghobject_t > &rollback_obs);
1231+
1232+ /* *
1233+ * Scan the given list of rollback objects for obsolete entries.
1234+ * If found - the obsolete entries are removed.
1235+ *
1236+ * @return 'true' if a transaction was issued.
1237+ */
1238+ bool _scan_rollback_obs (const std::vector<ghobject_t > &rollback_obs);
1239+
12321240 /* *
12331241 * returns true if [begin, end) is good to scrub at this time
12341242 * a false return value obliges the implementer to requeue scrub when the
Original file line number Diff line number Diff line change @@ -1381,9 +1381,13 @@ int PgScrubber::build_scrub_map_chunk(ScrubMap& map,
13811381 if (pos.ls .empty ()) {
13821382 break ;
13831383 }
1384- m_pg->_scan_rollback_obs (rollback_obs);
13851384 pos.pos = 0 ;
1386- return -EINPROGRESS;
1385+ if (m_pg->_scan_rollback_obs (rollback_obs)) {
1386+ // we had to perform some real work (queue a transaction
1387+ // to discard obsolete rollback versions of objects in the
1388+ // selected range). Let's reschedule the scrub.
1389+ return -EINPROGRESS;
1390+ }
13871391 }
13881392
13891393 // scan objects
You can’t perform that action at this time.
0 commit comments