From 4fe07b7f69321535a985958fc761a54cb71136f6 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 (cherry picked from commit fd38902dd4693b9b72f7532833e78f5df2c9efa5) --- 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 4df248476b542..a67201f5d66f1 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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; } -- 2.39.5