# lb readiness 2026-10-30T20:18:31Z
scripts/lb_readiness_check.sh
# LB excludes a not-ready but reachable replica (lab5)
# generated: 2026-10-30T20:18:32Z
# lb: haproxy:3.2-alpine@sha256:254e6370f01cd654e0744edf607c67f33777c1b6a9dc0d4b28bcba7171460122

## 1. baseline: requests through LB by replica
  22 23d07355bd77
  18 56bd7451c245
   stats: api1=UP api2=MAINT (resolution) api3=UP api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP

## 2. start a temporary TCP proxy to postgres and a candidate replica behind the same network alias
   instance-id: 42c73eb4c0a5, readiness while its database is reachable: 200
   load balancer slot for the candidate: api2, stats: api1=UP api2=UP 1/2 api3=UP api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP

## 3. cut the candidate's database access (stop only the TCP proxy)
   candidate is still running: running, readiness: 503
   waiting for the load balancer to mark api2 DOWN
   api2 went DOWN 1s after its database was cut (check: inter 2s fall 2)
   stats after failure: api1=UP api2=DOWN api3=UP api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP

## 4. 40 requests through LB while the candidate is not ready
  22 23d07355bd77
  18 56bd7451c245
   (the candidate must not appear above)

## 5. business writes through LB during the exclusion
  "failed_requests": 0,
  "error_ratio": 0.0,
  "successful_rps": 816.58,

## 6. cleanup
   stats after cleanup: api1=UP api2=MAINT (resolution) api3=UP api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
lb_readiness_check.sh: evidence in evidence/lab5/lb-readiness-detail.txt
