Skip to content

Commit f8ae0ab

Browse files
h4x3rotabclaude
andcommitted
fix(consul-postgres-ha): pass --base-id to each Envoy to avoid hot-restart socket clash
Both Envoys (webdemo + postgres) on a worker default to base-id=0 for their hot-restart Unix domain socket. The second one to start hits errno=98 (EADDRINUSE) and exits in a loop. Fixed by passing `--base-id 1` (webdemo) and `--base-id 2` (postgres). Distinct base IDs use distinct domain socket paths. Visible symptom before this fix: ps showed only one envoy process running on workers (whichever started first). The other's supervise loop spun on `unable to bind domain socket with base_id=0, id=0, errno=98`. postgres-master upstream listener (127.10.0.20:5432) was never bound, so Patroni replicas got "connection refused" on pg_basebackup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 57705ad commit f8ae0ab

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

consul-postgres-ha/mesh-sidecar/entrypoint.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ EOF
236236
-admin-bind="127.0.0.1:19000" \
237237
-bootstrap \
238238
> /tmp/envoy-webdemo.json 2>/dev/null; then
239-
envoy -c /tmp/envoy-webdemo.json -l info 2>&1
239+
# --base-id distinguishes this envoy from the postgres one
240+
# below; otherwise both fight over the default base-id=0
241+
# hot-restart domain socket and one fails with EADDRINUSE.
242+
envoy -c /tmp/envoy-webdemo.json -l info --base-id 1 2>&1
240243
else
241244
echo "[envoy-webdemo] waiting for webdemo sidecar registration..."
242245
fi
@@ -255,7 +258,8 @@ EOF
255258
-admin-bind="127.0.0.1:19001" \
256259
-bootstrap \
257260
> /tmp/envoy-postgres.json 2>/dev/null; then
258-
envoy -c /tmp/envoy-postgres.json -l info 2>&1
261+
# See note on --base-id in the webdemo envoy block above.
262+
envoy -c /tmp/envoy-postgres.json -l info --base-id 2 2>&1
259263
else
260264
echo "[envoy-postgres] waiting for ca leaf / proxy registration..."
261265
fi

0 commit comments

Comments
 (0)