From fd38902dd4693b9b72f7532833e78f5df2c9efa5 Mon Sep 17 00:00:00 2001 From: Zhiqiang Wang Date: Thu, 23 Jul 2015 09:26:44 +0800 Subject: [PATCH] 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 --- src/osd/ReplicatedPG.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- 2.47.3