The optional arg ("front") was meant to control if PG was supposed
to be put in front or back (default) of awaiting_throttle. For some
reason, this was't used at all, so this commit removes it and
replaces with logic that checks whether the PG has forcecd
backfill or recovery set, and lets it in the front only in that
case.
Signed-off-by: Piotr Dałek <piotr.dalek@corp.ovh.com>
}
}
// delayed pg activation
- void queue_for_recovery(PG *pg, bool front = false) {
+ void queue_for_recovery(PG *pg) {
Mutex::Locker l(recovery_lock);
- if (front) {
+
+ if (pg->get_state() & (PG_STATE_FORCED_RECOVERY | PG_STATE_FORCED_BACKFILL)) {
awaiting_throttle.push_front(make_pair(pg->get_osdmap()->get_epoch(), pg));
} else {
awaiting_throttle.push_back(make_pair(pg->get_osdmap()->get_epoch(), pg));
}
}
-void PG::queue_recovery(bool front)
+void PG::queue_recovery()
{
if (!is_primary() || !is_peered()) {
dout(10) << "queue_recovery -- not primary or not peered " << dendl;
} else {
dout(10) << "queue_recovery -- queuing" << dendl;
recovery_queued = true;
- osd->queue_for_recovery(this, front);
+ osd->queue_for_recovery(this);
}
}
virtual void kick_snap_trim() = 0;
virtual void snap_trimmer_scrub_complete() = 0;
bool requeue_scrub(bool high_priority = false);
- void queue_recovery(bool front = false);
+ void queue_recovery();
bool queue_scrub();
unsigned get_scrub_priority();