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)
!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;
}