gobridge

0011 — Cluster client-ID uniqueness enforcement

Status: accepted Date: 2026-07-13 Deciders: GoBridge core Decision recorded: commit 4d8d76d (2026-07-13, this ADR file) Implementation: original Session-Taken-Over handling (noteSessionTakeover) in commit 761a048 (2026-07-03); opt-in client_id_suffix uniquifier and Exclusive-session rejection in commit e48e879 (2026-07-10); takeover-penalty/decay and nonce fail-closed hardening in commit 4d8d76d (2026-07-13)

Context

MQTT requires a client identifier to be unique per broker connection. When two live instances connect with the same client_id, the broker enforces uniqueness the only way the protocol allows: it disconnects the incumbent with a Session-Taken-Over (0x8E), the kicked instance reconnects and kicks the other, and the two mutually evict each other in a tight loop — a self-inflicted denial of service that also churns subscriptions and in-flight state.

Two deployment shapes collide with this:

So the requirement is not “always unique” — it is “unique for scale-out, stable for exclusive”, and the bridge must make the right one easy and the wrong one loud.

Decision

Provide opt-in per-replica uniquification, forbid it exactly where a stable shared id is required, and detect a collision loudly and dampen its storm — but do not hard-mandate a suffix at build.

Consequences

Rejected alternatives