From: Samuel Just Date: Fri, 28 Mar 2014 20:25:41 +0000 (-0700) Subject: PG: always clear agent_state in clear_primary_state X-Git-Tag: v0.80-rc1~94^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a6be1d6713fe63e23217f4125bde12b4daaad142;p=ceph.git PG: always clear agent_state in clear_primary_state We aren't actually active between activate() and all_activated_committed(). We'd have to suspend agent_work during that period which seems like too much complexity for too little work saved. Fixes: #7904 Signed-off-by: Samuel Just --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 1b18d83ec593..6e80f0b9d244 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -793,7 +793,7 @@ void PG::build_prior(std::auto_ptr &prior_set) set_probe_targets(prior_set->probe); } -void PG::clear_primary_state(bool staying_primary) +void PG::clear_primary_state() { dout(10) << "clear_primary_state" << dendl; @@ -827,8 +827,7 @@ void PG::clear_primary_state(bool staying_primary) osd->recovery_wq.dequeue(this); osd->snap_trim_wq.dequeue(this); - if (!staying_primary) - agent_clear(); + agent_clear(); osd->remove_want_pg_temp(info.pgid.pgid); } @@ -4713,7 +4712,7 @@ void PG::start_peering_interval( // reset primary state? if (was_old_primary || is_primary()) - clear_primary_state(was_old_primary && is_primary()); + clear_primary_state(); // pg->on_* diff --git a/src/osd/PG.h b/src/osd/PG.h index 2e7a3fd0fdef..e3d6ffb67344 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -678,7 +678,7 @@ protected: void clear_publish_stats(); public: - void clear_primary_state(bool stay_primary); + void clear_primary_state(); public: bool is_actingbackfill(pg_shard_t osd) const { diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 1e57a3384528..7b8051a5d75e 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -8915,8 +8915,7 @@ void ReplicatedPG::on_shutdown() osd->remote_reserver.cancel_reservation(info.pgid); osd->local_reserver.cancel_reservation(info.pgid); - if (is_primary()) - clear_primary_state(false); // Not staying primary + clear_primary_state(); cancel_recovery(); }