]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Add scrub_supported() backend interface
authorDavid Zafman <david.zafman@inktank.com>
Fri, 24 Jan 2014 03:55:27 +0000 (19:55 -0800)
committerDavid Zafman <david.zafman@inktank.com>
Fri, 31 Jan 2014 19:00:22 +0000 (11:00 -0800)
Signed-off-by: David Zafman <david.zafman@inktank.com>
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PGBackend.h
src/osd/ReplicatedBackend.h

index 299ecd61288425e664b3842499952a6d3ebee816..38bb17194a36f5ebeb87be8884fb67ff6e917849 100644 (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)) {
index ee02a57c66d15e50a80bd6ad00a6fcea3f682549..83fa35b710d1cb60cf8cd88cd7fdfb5c9fb57ad5 100644 (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;
index 8c527d65086e709fbb557d3961d398da2a8ddb59..81a0ee5d1fd5ee3ebc159ff4fb7ce676d4950bd5 100644 (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:       
      const list<pair<pair<uint64_t, uint64_t>,
                pair<bufferlist*, Context*> > > &to_read,
      Context *on_complete) = 0;
+
+   virtual bool scrub_supported() { return false; }
  };
 
 #endif
index b152f42b0f83aeddd9904dc4a4ff0fc46bd56078..867ffa33b8beb072d401300548c9abb21dc86b0b 100644 (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