From 6107c1aa34559d96b7064afb8d639419b0c6d592 Mon Sep 17 00:00:00 2001 From: Artyom Date: Wed, 28 Oct 2026 20:07:44 +0300 Subject: [PATCH] Show the drain sequence of the stopped replica in failover evidence The failover evidence printed the last six log lines of the stopped replica, which no longer reach back to the signal now that shutdown starts with a two second drain window. It now filters the replica log since the start of the run for the signal, the drain message, the 503 readiness answers, the listener shutdown and the process exit. Co-Authored-By: Claude Opus 5.5 (1M context) --- scripts/failover-evidence.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/failover-evidence.sh b/scripts/failover-evidence.sh index 1bd18328..fb30bd36 100755 --- a/scripts/failover-evidence.sh +++ b/scripts/failover-evidence.sh @@ -5,6 +5,7 @@ replicas() { docker inspect -f '{{.Config.Hostname}} {{.State.Status}} started={{.State.StartedAt}} finished={{.State.FinishedAt}}' $(docker compose ps -aq "${API_SERVICE:-api}") } tmp=evidence/failover.tmp +since=$(date -u +%FT%TZ) { echo "date: $(date -u +%FT%TZ) commit: $(git rev-parse --short HEAD)" echo "== before: api replicas (hostname = X-Instance-Id), state, StartedAt, FinishedAt" @@ -16,8 +17,8 @@ tmp=evidence/failover.tmp } > "$tmp" 2>&1 stopped=$(replicas | awk '$2 == "exited" {print $1}') { - echo "== stopped replica: $stopped; last log lines of its process" - docker logs --tail 6 "$stopped" 2>&1 + echo "== stopped replica: $stopped; shutdown: signal, drain window with readiness 503, close, exit" + docker logs --since "$since" "$stopped" 2>&1 | grep -E 'Handling signal|Draining|"status":503|Shutting down|Waiting for conn|Finished server|service.stopped|SIGTERM' | tail -16 echo "\$ scripts/restore.sh" scripts/restore.sh echo "== after restore"