smengcl opened a new pull request, #11634:
URL: https://github.com/apache/ozone/pull/11634

   Generated-by: Claude Code (Opus 5.5)
   
   ## What changes were proposed in this pull request?
   
   The S3 Gateway HAProxy used by the `ozone-ha`, `ozonesecure-ha` and 
`upgrade/compose/ha` compose environments (all via `common/s3-haproxy.cfg`) can 
exit at startup and never come back.
   
   `haproxy:lts-alpine` (3.4.7) refuses to start if a server address cannot be 
resolved:
   
   ```
   [ALERT]    (8) : [/usr/local/etc/haproxy/haproxy.cfg:44] : 'server 
servers/server1' : could not resolve address 's3g1'.
   [ALERT]    (8) : Failed to initialize server(s) addr.
   ```
   
   Docker Compose starts services in parallel, so if HAProxy starts before 
`s3g1`..`s3g3` are registered in Docker DNS, it exits. Nothing restarts it, and 
since the compose files set `dns_search: .`, the `s3g` name then falls through 
to public DNS, so every S3 robot test hangs until its 5 minute timeout.
   
   This patch makes HAProxy resolve the S3 Gateways at runtime through Docker's 
embedded DNS (`resolvers docker`) and sets `default-server init-addr 
last,libc,none resolvers docker`. With `none`, HAProxy starts even if a server 
is not resolvable yet; that server stays disabled until the resolver finds it. 
One file covers all three environments.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17154
   
   ## How was this patch tested?
   
   - Minimal compose reproduction (`haproxy:lts-alpine` 3.4.7, busybox httpd as 
`s3g1`..`s3g3`, HAProxy started before the gateways). Original config: HAProxy 
exited with code 1 and stayed down. Fixed config: HAProxy kept running, logged 
`could not resolve address 's3g3', disabling server`, and later routed requests 
to the backends.
   - `ozone-ha/test-haproxy-s3g.sh` with the fixed config: 149 tests, all 
passed.
   - `upgrade/compose/ha` downgrade test: S3 robot steps went from timing out 
to passing once HAProxy could no longer exit at startup.
   - CI.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to