From: Xuehan Xu Date: Tue, 15 Oct 2024 05:59:50 +0000 (+0800) Subject: crimson/osd/pg: trigger PG::wait_for_active_blocker only when the pg is X-Git-Tag: v20.0.0~718^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=11e3ecabf971a7d1b0518239684a4ec2b76992d3;p=ceph.git 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 --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 97d48c1fa454..d17577792be9 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",