From e3300978025d53da3e29f61e2adb2a7edd43b5ad Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Fri, 14 Mar 2014 13:09:30 -0700 Subject: [PATCH] PG: clear want_pg_temp in clear_primary_state only if primary Clearing it in that way in on_shutdown() can cause a stray shard to clobber the want_pg_temp value created by the primary shard on the same osd. Thus, instead only clear it if we are the primary. Fixes: #7719 Signed-off-by: Samuel Just --- src/osd/PG.cc | 4 ++-- src/osd/ReplicatedPG.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 3d290ff93ba5..6cecf0cd3053 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -830,6 +830,8 @@ void PG::clear_primary_state(bool staying_primary) if (!staying_primary) agent_clear(); + + osd->remove_want_pg_temp(info.pgid.pgid); } /** @@ -4772,8 +4774,6 @@ void PG::start_peering_interval( } } } - // make sure we clear out any pg_temp change requests - osd->remove_want_pg_temp(info.pgid.pgid); cancel_recovery(); if (acting.empty() && !up.empty() && up_primary == pg_whoami) { diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 33bea32a72e5..7d16063da5b8 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -8920,8 +8920,8 @@ void ReplicatedPG::on_shutdown() osd->remote_reserver.cancel_reservation(info.pgid); osd->local_reserver.cancel_reservation(info.pgid); - clear_primary_state(false); // Not staying primary - osd->remove_want_pg_temp(info.pgid.pgid); + if (is_primary()) + clear_primary_state(false); // Not staying primary cancel_recovery(); } -- 2.47.3