From 11e3ecabf971a7d1b0518239684a4ec2b76992d3 Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Tue, 15 Oct 2024 13:59:50 +0800 Subject: [PATCH] crimson/osd/pg: trigger PG::wait_for_active_blocker only when the pg is going active Fixes: https://tracker.ceph.com/issues/68541 Signed-off-by: Xuehan Xu --- src/crimson/osd/pg.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 97d48c1fa45..d17577792be 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -389,7 +389,13 @@ void PG::on_replica_activate() void PG::on_activate_complete() { - wait_for_active_blocker.unblock(); + /* Confusingly, on_activate_complete is invoked when the primary and replicas + * have recorded the current interval. At that point, the PG may either become + * ACTIVE or PEERED, depending on whether the acting set is eligible for client + * IO. Only unblock wait_for_active_blocker if we actually became ACTIVE */ + if (peering_state.is_active()) { + wait_for_active_blocker.unblock(); + } if (peering_state.needs_recovery()) { logger().info("{}: requesting recovery", -- 2.39.5