From: Piotr Dałek Date: Mon, 20 Feb 2017 11:43:38 +0000 (+0100) Subject: OSD, PG: remove optional arg from queue_for_recovery X-Git-Tag: v12.1.2~145^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=50742c5cd0962d542ea2a1b0b5e32e68fe7b1a72;p=ceph.git OSD, PG: remove optional arg from queue_for_recovery 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 --- diff --git a/src/osd/OSD.h b/src/osd/OSD.h index bf81d196e958..6da927e1affd 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -947,9 +947,10 @@ public: } } // 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)); diff --git a/src/osd/PG.cc b/src/osd/PG.cc index d1b88b385da7..49eb61498b04 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1970,7 +1970,7 @@ bool PG::requeue_scrub(bool high_priority) } } -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; @@ -1980,7 +1980,7 @@ void PG::queue_recovery(bool front) } else { dout(10) << "queue_recovery -- queuing" << dendl; recovery_queued = true; - osd->queue_for_recovery(this, front); + osd->queue_for_recovery(this); } } diff --git a/src/osd/PG.h b/src/osd/PG.h index 868810d09986..d986f3f473c5 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -2397,7 +2397,7 @@ public: 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();