osd: Add scrub_supported() backend interface

Signed-off-by: David Zafman <david.zafman@inktank.com>
This commit is contained in:
David Zafman 2014-01-23 19:55:27 -08:00
parent 802692ed8e
commit 37447e758e
4 changed files with 6 additions and 1 deletions

View File

@ -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)) {

View File

@ -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;

View File

@ -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

View File

@ -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