]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: only remove all the hit set objects on primary osd
authorZhiqiang Wang <zhiqiang.wang@intel.com>
Thu, 23 Jul 2015 01:26:44 +0000 (09:26 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 9 Oct 2015 10:22:45 +0000 (03:22 -0700)
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>
(cherry picked from commit fd38902dd4693b9b72f7532833e78f5df2c9efa5)

src/osd/ReplicatedPG.cc

index 4df248476b542f003ed598cb77c67f0f80e62452..a67201f5d66f1deaadaa4dd08e2680ee74a0ba64 100644 (file)
@@ -10146,7 +10146,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;
   }