]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: always clear agent_state in clear_primary_state
authorSamuel Just <sam.just@inktank.com>
Fri, 28 Mar 2014 20:25:41 +0000 (13:25 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 28 Mar 2014 20:27:03 +0000 (13:27 -0700)
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 <sam.just@inktank.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/ReplicatedPG.cc

index 1b18d83ec593240f843ccc0a13fa64dfeb8b79bc..6e80f0b9d244b6001dd10b6c5f1f6a9334ff40d9 100644 (file)
@@ -793,7 +793,7 @@ void PG::build_prior(std::auto_ptr<PriorSet> &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_*
index 2e7a3fd0fdef1f6f787eb00920cdad2b417339ae..e3d6ffb67344007304985908443da0ea124475b2 100644 (file)
@@ -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 {
index 1e57a3384528c17e3498ce863826b5bf24ed7a6f..7b8051a5d75e17992a4666b00772edce50e79c36 100644 (file)
@@ -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();
 }