feat(haproxy): self-heal HAProxy 3.4 runtime dynamic backends - #1727
feat(haproxy): self-heal HAProxy 3.4 runtime dynamic backends#1727caffeinated92 wants to merge 5 commits into
Conversation
ReviewReviewed Bugs / CorrectnessWrite-leader row has no stale-address check, unlike the read side ( Performance
TestingTest coverage is extensive (2667 lines in Nits
VerdictRequesting changes — mainly on the write-leader stale-address gap, since it's the write path that self-heal is presumably most safety-critical for. Everything else here (docs, test breadth, read-side handling) is solid work. |
|
@claude review my PR changes |
|
Claude finished @caffeinated92's task in 1m 48s —— View job Review
I re-reviewed against the prior review comment on this PR (write-leader stale-address gap, 1. Write-leader stale-address gap — resolved, via explanation + pinning test, not a new check. 2. 3. gofmt nits — fixed. 4. T13 real-HAProxy regtest gate — still open, as before. Net: the follow-up commit is a good-faith, well-reasoned response to the earlier review — the write-leader concern in particular is resolved with a real explanation and a test that would catch a regression, not just a comment. Nothing new stood out in the diff itself. The only remaining item from my read is the regtest gate question above, which is a process/sign-off matter rather than a code defect. |
|
@claude review my PR changes |
|
Claude finished @caffeinated92's task in 1m 24s —— View job Review
Since the last review, one new commit landed: T13 regtest gate — now addressedThis is the item flagged as open in both prior reviews.
I checked the API usage against the actual signatures rather than trusting the doc comments: It's intentionally excluded from the default One doc gap
NetThis closes out the last remaining item from the prior two review rounds. Combined with the earlier fixes (write-leader stale-address explanation + pinning test, |
…ckends # Conflicts: # share/opensvc/moduleset_mariadb.svc.mrm.proxy.json
Problem
replication-manager's HAProxy runtime integration could reconcile server state only when the expected read/write backends and rows already existed in the running HAProxy process. If
service_write,service_read, or one of their expected rows was missing at runtime, repman could only log the failure and wait for a manual HAProxy reload.What this PR changes
This PR adds an optional HAProxy 3.4+ self-heal path for
haproxy-mode=runtimeapithat can recreate missing runtime backends/servers without a reload.Main changes
haproxy-runtime-dynamic-backendsto opt into the new behavioradd backendpublish backendadd serverenable serverenable healthdel servershow servers stateHaproxyProxy.Refresh()to detect and self-heal:leaderwrite rowerr == nil, since HAProxy often reports command rejection as plain CLI textSafety and compatibility
haproxy-mode=runtimeapidefaultssection unchanged and adding a separate trailingdefaults dyn_defaultssection used only by runtime-created backends viaadd backend ... from dyn_defaultsTests and validation
cluster/prx_haproxy_test.gofor:doc/implementation/cluster/HAPROXY_DYNAMIC_BACKENDS.mdgo test ./cluster/... -run Haproxygo test ./cluster/...go vet ./...haproxy:3.4-alpineScope notes
This PR keeps the existing fixed backend model (
service_write/service_read) and does not attempt a broader shared-HAProxy or multi-cluster backend redesign.Closes #1724