From 3992ec54af3af8e0c33e50cddafa26432058ad1e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 20 May 2026 12:03:12 +0800 Subject: [PATCH] crimson/osd: only unblock wait_for_active_blocker on replica when ACTIVE ReplicaActive::react(ActivateCommitted) sets ACTIVE or PEERED before calling on_activate_committed(). Without a guard, an unconditional unblock() on the PEERED path resets the promise, causing ops that arrive afterward to park indefinitely (until the next on_change()). The primary already has this guard in on_activate_complete(); mirror it on the replica side. See-also: 2389c32d517e Signed-off-by: Kefu Chai --- src/crimson/osd/pg.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index bb7c20dfd99..231421cec4e 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -544,7 +544,11 @@ public: } Context *on_clean() final; void on_activate_committed() final { - if (!is_primary()) { + // As in on_activate_complete(): ActivateCommitted may have left + // the PG in PG_STATE_PEERED (acting_set_writeable() returned + // false) rather than PG_STATE_ACTIVE. Only unblock when we + // actually became ACTIVE. + if (!is_primary() && peering_state.is_active()) { wait_for_active_blocker.unblock(); } } -- 2.47.3