From: Zhiqiang Wang Date: Thu, 23 Jul 2015 01:26:44 +0000 (+0800) Subject: osd: only remove all the hit set objects on primary osd X-Git-Tag: v9.1.0~329^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4998%2Fhead;p=ceph.git osd: only remove all the hit set objects on primary osd 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index f100a2f53ad7..c93851f23daf 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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; }