mirror of
https://github.com/ceph/ceph
synced 2025-01-20 18:21:57 +00:00
osd: Add scrub_supported() backend interface
Signed-off-by: David Zafman <david.zafman@inktank.com>
This commit is contained in:
parent
802692ed8e
commit
37447e758e
@ -4856,7 +4856,7 @@ void OSD::sched_scrub()
|
||||
|
||||
PG *pg = _lookup_lock_pg(pgid);
|
||||
if (pg) {
|
||||
if (pg->is_active() &&
|
||||
if (pg->get_pgbackend()->scrub_supported() && pg->is_active() &&
|
||||
(load_is_low ||
|
||||
(double)diff >= cct->_conf->osd_scrub_max_interval ||
|
||||
pg->scrubber.must_scrub)) {
|
||||
|
@ -3447,6 +3447,7 @@ void PG::scrub(ThreadPool::TPHandle &handle)
|
||||
*/
|
||||
void PG::classic_scrub(ThreadPool::TPHandle &handle)
|
||||
{
|
||||
assert(pool.info.type == pg_pool_t::TYPE_REPLICATED);
|
||||
if (!scrubber.active) {
|
||||
dout(10) << "scrub start" << dendl;
|
||||
scrubber.active = true;
|
||||
|
@ -34,6 +34,7 @@
|
||||
* 1) Handling client operations
|
||||
* 2) Handling object recovery
|
||||
* 3) Handling object access
|
||||
* 4) Handling scrub, deep-scrub, repair
|
||||
*/
|
||||
class PGBackend {
|
||||
public:
|
||||
@ -428,6 +429,8 @@
|
||||
const list<pair<pair<uint64_t, uint64_t>,
|
||||
pair<bufferlist*, Context*> > > &to_read,
|
||||
Context *on_complete) = 0;
|
||||
|
||||
virtual bool scrub_supported() { return false; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -489,6 +489,7 @@ private:
|
||||
};
|
||||
void sub_op_modify_applied(RepModifyRef rm);
|
||||
void sub_op_modify_commit(RepModifyRef rm);
|
||||
bool scrub_supported() { return true; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user