]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG,ReplicatedPG: on_removal must handle repop and watcher state
authorSamuel Just <sam.just@inktank.com>
Thu, 5 Jul 2012 22:39:24 +0000 (15:39 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 6 Jul 2012 00:18:55 +0000 (17:18 -0700)
on_removal is now in ReplicatedPG in order to handle watcher state
and repop state.  Addionally, workqueue dequeues are handled already
in OSD::_remove_pg.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index 1762f32fe53036368ca37bb2d43851727f32869b..1d22a11c366508864269e25a11abfd4271b8a07c 100644 (file)
@@ -3682,18 +3682,6 @@ bool PG::old_peering_msg(epoch_t reply_epoch, epoch_t query_epoch)
   return false;
 }
 
-
-void PG::on_removal()
-{
-  osd->recovery_wq.dequeue(this);
-  osd->scrub_wq.dequeue(this);
-  osd->scrub_finalize_wq.dequeue(this);
-  osd->snap_trim_wq.dequeue(this);
-  osd->pg_stat_queue_dequeue(this);
-
-  remove_watchers_and_notifies();
-}
-
 void PG::set_last_peering_reset()
 {
   dout(20) << "set_last_peering_reset " << get_osdmap()->get_epoch() << dendl;
index 3248a4009c483c1cd42acad80e7f58dadfd15f88..ab7b90f892e6a3fed40670e2caf8401e7a72357d 100644 (file)
@@ -1498,7 +1498,7 @@ public:
   void handle_loaded(RecoveryCtx *rctx);
   void handle_query_state(Formatter *f);
 
-  void on_removal();
+  virtual void on_removal();
 
 
   // abstract bits
index 91249b5a939a833623049ea31520fe8040830b9e..17128a76bf1d3ae1bfb67c474d9a84ce4cd06515 100644 (file)
@@ -5692,6 +5692,13 @@ void ReplicatedPG::apply_and_flush_repops(bool requeue)
   }
 }
 
+void ReplicatedPG::on_removal()
+{
+  dout(10) << "on_removal" << dendl;
+  apply_and_flush_repops(false);
+  remove_watchers_and_notifies();
+}
+
 void ReplicatedPG::on_shutdown()
 {
   dout(10) << "on_shutdown" << dendl;
index a3876a851dd1f25451ed90b32e93da1569ebfc5c..da85a6b92423041296da477fd4fa8662dffcf2bf 100644 (file)
@@ -913,6 +913,7 @@ public:
   void on_role_change();
   void on_change();
   void on_activate();
+  void on_removal();
   void on_shutdown();
 };