]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD, PG: remove optional arg from queue_for_recovery
authorPiotr Dałek <piotr.dalek@corp.ovh.com>
Mon, 20 Feb 2017 11:43:38 +0000 (12:43 +0100)
committerPiotr Dałek <piotr.dalek@corp.ovh.com>
Thu, 20 Jul 2017 07:35:53 +0000 (09:35 +0200)
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>
src/osd/OSD.h
src/osd/PG.cc
src/osd/PG.h

index bf81d196e9587c08ab501adf7fcc941baddf2fa3..6da927e1affd73443b91b253b77f84a1e0a0db0d 100644 (file)
@@ -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));
index d1b88b385da7c75d7dc6daef44f8fb59a38e1383..49eb61498b0444ee3d4ac03357b3b4c1286a8920 100644 (file)
@@ -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);
   }
 }
 
index 868810d099865b3e7d0a085707a1b1b5d922f87b..d986f3f473c58ea87a1e0640c4de610022d19eef 100644 (file)
@@ -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();