]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: clear want_pg_temp in clear_primary_state only if primary 1472/head 1473/head
authorSamuel Just <sam.just@inktank.com>
Fri, 14 Mar 2014 20:09:30 +0000 (13:09 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 14 Mar 2014 20:09:32 +0000 (13:09 -0700)
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 <sam.just@inktank.com>
src/osd/PG.cc
src/osd/ReplicatedPG.cc

index 3d290ff93ba5d74531664211a427dbe5a8a9d5ff..6cecf0cd3053c764e763140bf91c692f54ff4555 100644 (file)
@@ -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) {
index 33bea32a72e50d447ff87108a0cfd88ab86590ae..7d16063da5b8af682dc0e42addec68b05e649027 100644 (file)
@@ -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();
 }