Should take care of #1599.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
}
- // remove_watchers_and_notifies and the erasure from the pg_map
- // must be done together without unlocking the pg lock,
+ // on_removal, which calls remove_watchers_and_notifies, and the erasure from
+ // the pg_map must be done together without unlocking the pg lock,
// to avoid racing with watcher cleanup in ms_handle_reset
// and handle_notify_timeout
- pg->remove_watchers_and_notifies();
+ pg->on_removal();
// remove from map
pg_map.erase(pgid);
bool _enqueue(PG *pg) {
if (pg->snap_trim_item.is_on_list())
return false;
+ pg->get();
osd->snap_trim_queue.push_back(&pg->snap_trim_item);
return true;
}
void _dequeue(PG *pg) {
- pg->snap_trim_item.remove_myself();
+ if (pg->snap_trim_item.remove_myself())
+ pg->put();
}
PG *_dequeue() {
if (osd->snap_trim_queue.empty())
last_peering_reset > query_epoch);
}
+
+void PG::on_removal()
+{
+ osd->recovery_wq.dequeue(this);
+ osd->backlog_wq.dequeue(this);
+ osd->scrub_wq.dequeue(this);
+ osd->scrub_finalize_wq.dequeue(this);
+ osd->snap_trim_wq.dequeue(this);
+ osd->remove_wq.dequeue(this);
+ osd->pg_stat_queue_dequeue(this);
+
+ remove_watchers_and_notifies();
+}
+
void PG::set_last_peering_reset() {
last_peering_reset = osd->osdmap->get_epoch();
}
recovery_state.handle_loaded(rctx);
}
-
+ void on_removal();
// abstract bits
virtual void do_op(MOSDOp *op) = 0;
virtual void do_sub_op(MOSDSubOp *op) = 0;
dout(10) << " can't write, requeueing" << dendl;
queue_snap_trim();
unlock();
+ put();
return true;
}
if (!finalizing_scrub) {
queue_snap_trim();
}
unlock();
+ put();
return true;
}