You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two findings from live verification of the declarative-services refactor:
1. README's PHALA_CLOUD_API_KEY snippet silently followed
`~/.phala-cloud/credentials.json`'s `current_profile`, so the
deploy billed whichever account was last `phala auth login`-ed
into. Replace with an explicit `export PHALA_CLOUD_API_KEY=phak_...`
instruction so the user picks a specific token. Caught when a
verification run deployed onto an unrelated profile.
2. mesh-conn's "fresh auth supersedes consumed" cancellation
(commit cc5a12d) is symmetric — when both peers restart in
close succession, each side keeps cancelling the other's
in-flight dial as fresher auth arrives, and the 5-second
back-off doesn't break the symmetry. Observed in live testing:
multiple worker↔coordinator pairs flapping >7 minutes without
converging, blocking Consul RPC and replica pg_basebackup.
Adds an "ICE auth-race convergence bug" section to
ROBUSTNESS.md walking the symptom, the diagnosis, and three
possible fix shapes (asymmetric back-off keyed on peer-id
lexicographic order is the cheapest experiment). Promotes it
to top of the Layer 1 recommended-fixes list.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: consul-postgres-ha/ROBUSTNESS.md
+69-2Lines changed: 69 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,13 +97,80 @@ whose direct path goes down can't fail over to TURN until it's back".
97
97
| Resource exhaustion (many TCP streams) | QUIC per-session limits kick in (256 streams default); new TCP streams to that peer fail. UDP and existing TCP unaffected. | bump `AcceptBacklog` / `MaxIncomingStreams` if it ever hits us at scale. |
98
98
| Head-of-line blocking | A big TCP write on one stream briefly delays a UDP datagram or another TCP stream. Imperceptible at Consul scale. | None needed today. If a future workload becomes jitter-sensitive, split into two ICE conns per pair (UDP-only + TCP-only). |
99
99
100
+
### The ICE auth-race convergence bug — the one real open issue
101
+
102
+
`dialICE` both publishes its local auth (ufrag+pwd) via the signalling
103
+
broker and waits on the remote auth from the broker. On a peer
104
+
restart or fresh bring-up, both sides republish in close succession.
105
+
mesh-conn's protection against consuming a stale auth is to compare
106
+
the most-recently-seen remote auth against the one it's currently
107
+
dialing against; if a fresher auth arrives mid-dial, the in-flight
108
+
attempt is cancelled and `runPeerLink` retries after 5 s.
109
+
110
+
What goes wrong is that **both peers do this symmetrically**:
111
+
112
+
```
113
+
peer-A consumed=X publishes auth Y → dials with peer-B's X
114
+
peer-B sees A's Y, supersedes its X-bound dial, publishes new auth Z
115
+
peer-A sees B's Z, supersedes its Y-bound dial
116
+
peer-B sees A's next auth, supersedes again
117
+
…
118
+
```
119
+
120
+
The 5 s back-off doesn't break the symmetry, so the loop never
121
+
converges. Observed in live testing on 2026-05-13: multiple worker↔
122
+
coordinator and worker↔worker pairs flapping for 7+ minutes without
123
+
stabilizing, even with `MESH_CONN_RELAY_ONLY=1` set (so it's not a
0 commit comments