]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix PrimaryLogPG op ordering during laggy state 67945/head
authorDror Guy <drorg@ionir.com>
Mon, 23 Mar 2026 07:08:47 +0000 (09:08 +0200)
committerDror Guy <drorg@ionir.com>
Tue, 31 Mar 2026 09:48:53 +0000 (12:48 +0300)
When ops are kicked back from the waiting lists unreadable, degraded,
blocked etc during laggy state, they bypass newer ops in the
waiting_for_readable list. This fix places the kicked back waiting
list directly into the waiting_for_readable list with the right op order.

Fixes: https://tracker.ceph.com/issues/75403
Signed-off-by: Dror Guy <drorg@ionir.com>
src/osd/PG.cc
src/osd/PrimaryLogPG.cc

index 7745ea5bb888b25b705141b9226edb00b4c6fa58..cd447ee2c964fe2e230c00347f28dc6b5ade9191 100644 (file)
@@ -1215,6 +1215,17 @@ void PG::requeue_op(OpRequestRef op)
 
 void PG::requeue_ops(list<OpRequestRef> &ls)
 {
+  if (!waiting_for_readable.empty() && &ls != &waiting_for_peered &&
+      &ls != &waiting_for_flush && &ls != &waiting_for_active &&
+      &ls != &waiting_for_readable) {
+    dout(20) << __func__ << " not readable ops (count=" << ls.size() << ")"
+             << dendl;
+    for (auto& op : ls) {
+      op->mark_delayed("waiting for readable");
+    }
+    waiting_for_readable.splice(waiting_for_readable.begin(), ls);
+  }
+
   for (list<OpRequestRef>::reverse_iterator i = ls.rbegin();
        i != ls.rend();
        ++i) {
index 3cc179f2ac3219092476dbd9a07834b9aa881063..2200f5e031036388f5111199500644efccc5d82b 100644 (file)
@@ -1754,28 +1754,14 @@ void PrimaryLogPG::release_object_locks(
 
   if (!to_req.empty()) {
     // requeue at front of scrub blocking queue if we are blocked by scrub
-    for (auto &&p: to_req) {
+    for (auto&& p : to_req) {
       if (m_scrubber->write_blocked_by_scrub(p.first->obs.oi.soid.get_head())) {
         for (auto& op : p.second) {
           op->mark_delayed("waiting for scrub");
         }
-
-       waiting_for_scrub.splice(
-         waiting_for_scrub.begin(),
-         p.second,
-         p.second.begin(),
-         p.second.end());
-      } else if (is_laggy()) {
-        for (auto& op : p.second) {
-          op->mark_delayed("waiting for readable");
-        }
-       waiting_for_readable.splice(
-         waiting_for_readable.begin(),
-         p.second,
-         p.second.begin(),
-         p.second.end());
+        waiting_for_scrub.splice(waiting_for_scrub.begin(), p.second);
       } else {
-       requeue_ops(p.second);
+        requeue_ops(p.second);
       }
     }
   }