PG,ReplicatedPG: on_removal must handle repop and watcher state

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>
This commit is contained in:
Samuel Just 2012-07-05 15:39:24 -07:00
parent 691741985a
commit 09af670b1d
4 changed files with 9 additions and 13 deletions

View 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;

View 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

View 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;

View File

@ -913,6 +913,7 @@ public:
void on_role_change();
void on_change();
void on_activate();
void on_removal();
void on_shutdown();
};