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 <k.chai@proxmox.com>
}
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();
}
}