Skip to content

Commit

Permalink
ReplicatedPG::hit_set_setup: fix hit_set_remove_all call
Browse files Browse the repository at this point in the history
We only want to do it if the pool config changed AND we are
primary && active.

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

Fixes: 13192
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 36e4a80)
  • Loading branch information
athanatos authored and tchaikov committed Oct 9, 2015
1 parent ab3877d commit 6a4734a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/osd/ReplicatedPG.cc
Expand Up @@ -10141,15 +10141,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;
}

Expand Down

0 comments on commit 6a4734a

Please sign in to comment.