]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: only remove all the hit set objects on primary osd 4998/head
authorZhiqiang Wang <zhiqiang.wang@intel.com>
Thu, 23 Jul 2015 01:26:44 +0000 (09:26 +0800)
committerZhiqiang Wang <zhiqiang.wang@intel.com>
Fri, 21 Aug 2015 07:48:20 +0000 (15:48 +0800)
Only the primary PG is allowed to remove all the hit set objects. And
the PG should be in the active or peered states.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
src/osd/ReplicatedPG.cc

index f100a2f53ad7f6146372e845e784738fb021faa1..c93851f23daf4030df74dc432db4a3bf401b651b 100644 (file)
@@ -10568,7 +10568,10 @@ void ReplicatedPG::hit_set_setup()
       !pool.info.hit_set_period ||
       pool.info.hit_set_params.get_type() == HitSet::TYPE_NONE) {
     hit_set_clear();
-    hit_set_remove_all();
+    // only primary is allowed to remove all the hit set objects
+    if (is_primary() && is_peered()) {
+      hit_set_remove_all();
+    }
     return;
   }