Status: accepted Date: 2026-09-21 Deciders: GoBridge core Relates to: 0012 (no-op reloads stay accepted), 0013 (the rollout candidate and committed-artifact digests are taken over the same form)
Before the bridge replaces its runtime with a new configuration it checks whether the new configuration is the same as the running one, and skips the replacement when it is. Every accepted change replaces the whole runtime, so every session disconnects and connects again. The check therefore decides whether an update costs an outage.
That check compared the exact bytes of the document. Three places made the decision — the Supervisor’s no-op check, the configuration manager’s desired-versus-running fingerprint and the AWS runtime’s skip check — each with its own projection of the document, and each counted the following as a change:
bridge.drain_timeout: 30s;30s and the other as 30000ms.Tools that generate configuration rarely write the same bytes twice, and a shared configuration has several writers. Each of these harmless writes reconnected every session of every owner.
The same projection is also the identity a coordinated cluster rollout agrees on: the proposer records a digest of the candidate, every member recomputes it over the document its own source delivered, and the durable committed-config artifact carries the digest of what the cohort committed. That identity had to stay deterministic across members.
One normal form, defined once, in ports. ports.ContentNormalForm
returns a copy of a BridgeConfig in the shape every content-identity check
compares. It is a pure transformation of the blueprint, with no JSON or YAML
involved, so it can live in the inner ring next to the type it normalises. It
never modifies its input and never rewrites a plugin’s decoded options.
The normal form:
Version. It is the counter writers use to avoid overwriting each
other, not something the bridge runs. Ordering of updates is still enforced
by the callers that read it (the AWS runtime’s stale-source guard runs before
the content check), so leaving it out does not weaken that ordering;Sessions, Receivers, Senders, Bindings and Routes by id,
stably, because every other part of the document refers to their entries by
id and their position carries no meaning;bridge.cluster.members) as well, because the
bridge treats it as a set everywhere it reads it: deployment admission,
the reload preflight and the rollout coordinator all sort it;time.Duration’s own spelling, so 30000ms
and 30s are one value. A value that cannot be parsed is kept as written, so
it still takes part in the comparison and a document that cannot be brought
into the normal form counts as a change (fail safe);runtime.Val does, on the same concrete types: nil stays nil, a
string and a bool keep their kind, every built-in number and a decoded JSON
number become the float64 the runtime compares (so two integers the
runtime cannot tell apart are one rule here too), the four list types the
runtime knows keep their element kinds, and anything else, a map or a named
type for instance, becomes the string fmt.Sprint gives. An empty list becomes a private marker value that neither
a document nor a caller can carry, so an empty map, an empty list, a literal
string and an absent value are all different rules in the identity, as they
are different matches at runtime, and the empty-collection rule below cannot
fold any of them together;ports itself defines, bridge.shutdown_timeout
and bridge.drain_timeout, for a value that is left out (the 30 seconds their
accessors fall back to). A written value is kept as written, an explicit zero
included: the validator rejects a zero timeout, and equating it with the
default would let an invalid document be adopted as a no-op before validation
sees it. Defaults owned by other layers (the outbox drainer, the session
runtime, a transport) are not filled in; an unset value stays unset and
compares as unset.Every content identity is taken over it. bridge.configContentEqual, the
rollout candidate and committed-artifact digest (bridge.ConfigArtifactDigest),
the configuration manager’s fingerprint and the AWS runtime’s skip check (which
now calls bridge.ConfigArtifactDigest) all project the normal form. They can
no longer disagree about what counts as a change. Their JSON encoders stay
where they were, because the inner ring deliberately carries no JSON
dependency, but the second rule they apply to the decoded tree is shared as
well: ports.WithoutEmptyCollections makes an absent collection and an empty
one the same value in an object field (a document read back from a store turns
a nil slice into an empty one), in the bridge’s projection and in the manager’s
fingerprint alike, for the blueprint and for every plugin’s options. Inside a
list it does not: an element’s position and kind are content and the wire
format keeps an empty object, an empty list and null apart, so they stay three
different elements. A keyword field that
happens to look like a duration, such as ack_after, is compared as written.
Both projections decode numbers with json.Decoder.UseNumber, so an integer
above 2^53 is never rounded through float64 and two distinct values never
share an identity. One boundary of the collapse rule is accepted: a decoded
tree cannot tell an object that came from a struct field from a data map a
plugin passes through verbatim (an AMQP argument table), so an entry in such a
map whose value is an empty table or an explicit null compares like an absent
entry. The fold cannot be narrowed: a nil slice or map field marshals as null
and reads back from a document as an empty collection, and the rollout quorum
depends on the in-memory document and the read-back document projecting alike.
No shipped transport gives such an entry a meaning of its own; a precise,
type-aware rule would need a reflective copy of every plugin’s options and is
not worth that for a case nothing uses.
bridge.DeploymentBaselineContentDigest is now the same value as
bridge.ConfigArtifactDigest. The name is kept because the AWS deployment
stamps it (dynamodb_ha_baseline_config_digest).
One check is deliberately not a content check. The gobridge command’s reload
pipeline recognises the file watcher’s re-emit of the very document an admin
apply just wrote, so that document is not applied twice; it compares the
document, not the content. Anything else, including an equivalent document at
another version, is forwarded, and the Supervisor’s no-op path decides and
adopts it. A content comparison there would acknowledge such a document to the
manager without the Supervisor ever seeing it.
A no-op reload adopts the document. When the new configuration has the
running configuration’s normal form, the runtime is kept and every session stays
connected, but the new document becomes the applied configuration: the
Supervisor’s Config() and the AWS runtime’s applied configuration report the
version number that now describes the running content, in step with the
configuration manager’s running version. The post-swap convergence watcher
reads that version when it writes a diagnostic, so a warning or degraded
reason raised after an adoption names the adopted document too.
Digests recorded before the normal form are still readable. A rollout row and a committed-config artifact written by an earlier release carry a digest of the raw document. When the bridge reads such a record it accepts either the normal-form digest or the digest of the raw document, so an upgraded member neither refuses to start on its committed configuration nor reports a false rollout divergence. Three details make that hold after the upgrade, not only at the moment of it:
The raw-document digest is never written again; the first commit on the new
release replaces the record. The reader that reproduces it is a fossil: it
recomputes the old projection byte for byte, including the way it rounded
integers above 2^53 through float64, and it must never be corrected, or a
valid old record would stop matching. The fallback can be removed once no
cohort can still hold a record written before the normal form.
The committed artifact’s version is still checked, separately. The digest
leaves the version out, so on its own it no longer proves that a decoded
artifact carries the version its record names. The writer therefore stamps the
bytes with the rollout row’s version before encoding them: members whose
sources delivered equivalent documents at different versions join one rollout,
and whichever of them writes the artifact, the record and its bytes agree. A
decoded document whose version differs from the record’s ConfigVersion is
consequently corrupt and is rejected, in boot resolution and in reconciliation
alike. That keeps the corruption check the byte digest used to give, without
putting the version back into the identity.
ports shared by all three checks. Rejected: the
inner ring carries no JSON dependency by design, and the shape is what had to
be shared, not the encoder.ports would
let the identity drift from the runtime. The normal form fills in only the
defaults ports owns.