From 37ca0e0f773b3e31d6f7d71a621513a718819525 Mon Sep 17 00:00:00 2001 From: Dror Guy Date: Mon, 23 Mar 2026 09:08:47 +0200 Subject: [PATCH] osd: fix PrimaryLogPG op ordering during laggy state 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 --- src/osd/PG.cc | 11 +++++++++++ src/osd/PrimaryLogPG.cc | 20 +++----------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 7745ea5bb888..cd447ee2c964 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1215,6 +1215,17 @@ void PG::requeue_op(OpRequestRef op) void PG::requeue_ops(list &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::reverse_iterator i = ls.rbegin(); i != ls.rend(); ++i) { diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 3cc179f2ac32..2200f5e03103 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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); } } } -- 2.47.3