Skip to content

Conversation

hors
Copy link
Collaborator

@hors hors commented Oct 4, 2025

K8SPXC-1725 Powered by Pull Request Badge

CHANGE DESCRIPTION

Solution:
Adds the on-marked-down shutdown-sessions directive to ensure that any persistent connections to a backend server are immediately closed upon its health check failure. This is critical for our database/stateful services to guarantee a quick and complete failover to a healthy node.

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PXC version?
  • Does the change support oldest and newest supported Kubernetes version?

Adds the on-marked-down shutdown-sessions directive to
ensure that any persistent connections to a backend
server are immediately closed upon its health check failure.
This is critical for our database/stateful services
to guarantee a quick and complete failover to a healthy node.
@pull-request-size pull-request-size bot added the size/XS 0-9 lines label Oct 4, 2025
SERVER_OPTIONS=${HA_SERVER_OPTIONS:-'resolvers kubernetes check inter 10000 rise 1 fall 2 weight 1 on-marked-down shutdown-sessions'}
send_proxy=''
path_to_haproxy_cfg='/etc/haproxy/pxc'
if [[ "${IS_PROXY_PROTOCOL}" = "yes" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change
if [[ "${IS_PROXY_PROTOCOL}" = "yes" ]]; then
if [[ ${IS_PROXY_PROTOCOL} == "yes" ]]; then

@hors hors added this to the v1.19.0 milestone Oct 4, 2025
timstoop added a commit to timstoop/percona-xtradb-cluster-operator that referenced this pull request Oct 6, 2025
As requested in PR review, this feature is being added separately in PR percona#2205.

Also fixed HA_SERVER_OPTIONS to allow custom values via secret:
- When healthCheck is not configured in the CR, HA_SERVER_OPTIONS env var
  is not set by the operator, allowing it to be customized via the
  haproxy-env-vars secret or use the script's default value
- When healthCheck is configured, the operator generates HA_SERVER_OPTIONS
  with the specified interval, rise, and fall values

Changes:
- Removed ShutdownOnMarkDown field from HAProxyHealthCheckSpec API
- Removed HA_SHUTDOWN_ON_MARK_DOWN env var and shutdown_on_mark_down logic
- Updated CRDs and generated code
- Updated tests
- Updated example CR documentation
@JNKPercona
Copy link
Collaborator

Test Name Result Time
affinity-8-0 passed 00:06:29
auto-tuning-8-0 passed 00:19:50
cross-site-8-0 passed 00:35:34
custom-users-8-0 failure 00:09:30
demand-backup-cloud-8-0 passed 00:56:35
demand-backup-encrypted-with-tls-8-0 passed 00:44:21
demand-backup-8-0 passed 00:42:13
demand-backup-flow-control-8-0 passed 00:10:59
demand-backup-parallel-8-0 passed 00:09:01
demand-backup-without-passwords-8-0 passed 00:15:48
haproxy-5-7 passed 00:14:38
haproxy-8-0 passed 00:13:38
init-deploy-5-7 passed 00:16:59
init-deploy-8-0 passed 00:17:29
limits-8-0 passed 00:11:59
monitoring-2-0-8-0 passed 00:22:58
monitoring-pmm3-8-0 passed 00:17:56
one-pod-5-7 passed 00:14:20
one-pod-8-0 passed 00:13:10
pitr-8-0 passed 00:45:21
pitr-gap-errors-8-0 passed 00:56:00
proxy-protocol-8-0 passed 00:09:41
proxysql-sidecar-res-limits-8-0 passed 00:08:19
pvc-resize-5-7 passed 00:16:03
pvc-resize-8-0 passed 00:15:48
recreate-8-0 passed 00:17:09
restore-to-encrypted-cluster-8-0 passed 00:25:35
scaling-proxysql-8-0 passed 00:08:37
scaling-8-0 passed 00:10:49
scheduled-backup-5-7 passed 01:05:45
scheduled-backup-8-0 passed 01:02:38
security-context-8-0 passed 00:26:07
smart-update1-8-0 passed 00:32:14
smart-update2-8-0 passed 00:38:28
storage-8-0 passed 00:10:06
tls-issue-cert-manager-ref-8-0 passed 00:08:58
tls-issue-cert-manager-8-0 passed 00:11:30
tls-issue-self-8-0 passed 00:13:13
upgrade-consistency-8-0 passed 00:11:17
upgrade-haproxy-5-7 passed 00:24:41
upgrade-haproxy-8-0 passed 00:24:27
upgrade-proxysql-5-7 passed 00:15:14
upgrade-proxysql-8-0 passed 00:15:18
users-5-7 passed 00:24:57
users-8-0 passed 00:25:36
validation-hook-8-0 passed 00:01:53
We run 46 out of 46 16:59:33

commit: b39bf84
image: perconalab/percona-xtradb-cluster-operator:PR-2205-b39bf841

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS 0-9 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants