]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG::hit_set_setup: fix hit_set_remove_all call 6119/head
authorSamuel Just <sjust@redhat.com>
Mon, 21 Sep 2015 18:16:49 +0000 (11:16 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 23 Sep 2015 00:40:48 +0000 (17:40 -0700)
We only want to do it if the pool config changed AND we are
primary && active.

fd38902dd4693b9b72f7532833e78f5df2c9efa5 partially fixed a related
bug.  This should be backported along with it.

Fixes: 13192
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc

index cfda5b00dfd8f83c26595b1ca6242189bcfdaff8..88ac4b92f3fcc877f83248e9cd6c370ae91af27a 100644 (file)
@@ -10742,15 +10742,19 @@ void ReplicatedPG::hit_set_clear()
 void ReplicatedPG::hit_set_setup()
 {
   if (!is_active() ||
-      !is_primary() ||
-      !pool.info.hit_set_count ||
-      !pool.info.hit_set_period ||
-      pool.info.hit_set_params.get_type() == HitSet::TYPE_NONE) {
+      !is_primary()) {
     hit_set_clear();
+    return;
+  }
+
+  if (is_active() && is_primary() &&
+      (!pool.info.hit_set_count ||
+       !pool.info.hit_set_period ||
+       pool.info.hit_set_params.get_type() == HitSet::TYPE_NONE)) {
+    hit_set_clear();
+
     // only primary is allowed to remove all the hit set objects
-    if (is_primary() && is_peered()) {
-      hit_set_remove_all();
-    }
+    hit_set_remove_all();
     return;
   }