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();
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;
}
[[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
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