Skip to content

K8SPS-856: Don't reload haproxy on DNS changes - #1489

Draft
egegunes wants to merge 2 commits into
mainfrom
K8SPS-856
Draft

K8SPS-856: Don't reload haproxy on DNS changes#1489
egegunes wants to merge 2 commits into
mainfrom
K8SPS-856

Conversation

@egegunes

Copy link
Copy Markdown
Contributor

CHANGE DESCRIPTION

Problem:
Reloading HAProxy drops all connections. This means clients' connections to primary drop even when a secondary is restarted.

Solution:
Don't reload. Have a static list of MySQL servers and enable them according to cluster size.

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?

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 PS version?
  • Does the change support oldest and newest supported Kubernetes version?

@pull-request-size pull-request-size Bot added the size/L 100-499 lines label Aug 13, 2026
@github-actions github-actions Bot added the build label Aug 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[shellcheck (suggestion)] reported by reviewdog 🐶

Copy link
Copy Markdown
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 🐶

if [ ! -f '/etc/haproxy/mysql/haproxy.cfg' ]; then
cp /opt/percona/haproxy.cfg /etc/haproxy/mysql
fi

Copy link
Copy Markdown
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 🐶

custom_conf='/etc/haproxy-custom/haproxy.cfg'
if [ -f "$custom_conf" ]; then
log "haproxy -c -f $custom_conf -f /etc/haproxy/mysql/haproxy.cfg"
haproxy -c -f $custom_conf -f /etc/haproxy/mysql/haproxy.cfg || EC=$?
if [ -n "$EC" ]; then
log "The custom config $custom_conf is not valid and will be ignored."
fi
fi
haproxy_opt='-W -db '
if [ -f "$custom_conf" -a -z "$EC" ]; then
haproxy_opt+="-f $custom_conf "
else
haproxy_opt+='-f /opt/percona/haproxy-global.cfg '
fi
haproxy_opt+='-f /etc/haproxy/mysql/haproxy.cfg -p /etc/haproxy/mysql/haproxy.pid -S /etc/haproxy/mysql/haproxy-main.sock'
if [ -f '/etc/haproxy/config/haproxy.cfg' ]; then
haproxy_opt="${haproxy_opt} -f /etc/haproxy/config/haproxy.cfg"
fi

@JNKPercona

Copy link
Copy Markdown
Collaborator
Test Name Result Time
async-ignore-annotations-8-4 passed 00:06:45
async-global-metadata-8-4 passed 00:13:27
async-upgrade-8-0 passed 00:11:32
async-upgrade-8-4 passed 00:11:18
auto-config-8-4 failure 00:17:12
config-8-4 passed 00:27:01
config-router-8-0 passed 00:10:15
config-router-8-4 passed 00:07:00
custom-users-8-4 passed 00:06:25
demand-backup-8-0 passed 00:20:16
demand-backup-8-4 passed 00:19:39
gr-pitr-minio-8-4 passed 00:28:59
gr-pitr-encrypted-minio-8-4 passed 00:16:05
gr-pitr-one-pod-8-4 failure 00:20:10
async-pitr-minio-8-4 passed 00:28:17
demand-backup-cloud-8-4 failure 00:09:16
demand-backup-retry-8-4 passed 00:20:08
demand-backup-incremental-8-0 passed 00:35:34
demand-backup-incremental-8-4 passed 00:34:14
async-data-at-rest-encryption-8-0 passed 00:14:51
async-data-at-rest-encryption-8-4 failure 00:09:10
gr-cross-cluster-8-0 passed 00:18:03
gr-cross-cluster-8-4 passed 00:20:12
gr-cross-cluster-backup-8-0 failure 00:04:46
gr-cross-cluster-backup-8-4 passed 00:29:16
gr-global-metadata-8-4 passed 00:14:35
gr-data-at-rest-encryption-8-0 passed 00:15:50
gr-data-at-rest-encryption-8-4 passed 00:16:00
gr-demand-backup-8-4 passed 00:12:53
gr-demand-backup-cloud-8-4 passed 00:23:48
gr-demand-backup-haproxy-8-4 passed 00:11:19
gr-demand-backup-incremental-8-0 passed 00:24:26
gr-demand-backup-incremental-8-4 passed 00:25:28
gr-demand-backup-incremental-compressed-8-0 passed 00:15:26
gr-demand-backup-incremental-compressed-8-4 passed 00:11:49
gr-demand-backup-incremental-encrypted-8-0 passed 00:18:41
gr-demand-backup-incremental-encrypted-8-4 passed 00:19:08
gr-finalizer-8-4 passed 00:06:08
gr-haproxy-8-0 passed 00:05:02
gr-haproxy-8-4 passed 00:04:30
gr-ignore-annotations-8-4 passed 00:04:52
gr-init-deploy-8-0 passed 00:09:59
gr-init-deploy-8-4 passed 00:13:40
gr-one-pod-8-4 passed 00:05:41
gr-recreate-8-4 passed 00:17:28
gr-scaling-8-4 passed 00:08:17
gr-scheduled-backup-8-4 passed 00:26:48
gr-scheduled-backup-incremental-8-4 passed 00:37:02
gr-security-context-8-4 passed 00:10:23
gr-self-healing-8-4 failure 00:20:35
gr-tls-cert-manager-8-4 passed 00:11:42
gr-users-8-4 passed 00:07:46
gr-upgrade-8-0 passed 00:09:02
gr-upgrade-8-4 passed 00:09:58
haproxy-8-0 failure 00:08:44
haproxy-8-4 failure 00:08:39
init-deploy-8-0 passed 00:05:54
init-deploy-8-4 passed 00:06:10
limits-8-4 passed 00:04:38
monitoring-8-4 passed 00:18:35
one-pod-8-0 failure 00:06:14
one-pod-8-4 failure 00:06:04
operator-self-healing-8-4 passed 00:13:03
pvc-auto-resize-8-4 passed 00:06:04
pvc-resize-8-4 passed 00:06:23
recreate-8-4 passed 00:13:14
scaling-8-4 passed 00:11:02
scheduled-backup-8-0 failure 00:09:10
scheduled-backup-8-4 failure 00:09:07
scheduled-backup-incremental-8-0 passed 00:39:11
scheduled-backup-incremental-8-4 passed 00:33:55
service-per-pod-8-4 passed 00:06:31
sidecars-8-4 passed 00:04:56
smart-update-8-4 passed 00:09:08
storage-8-4 passed 00:03:57
switch-cluster-type-8-4 passed 00:12:23
telemetry-8-4 passed 00:06:26
tls-cert-manager-8-4 passed 00:12:08
users-8-0 passed 00:09:08
users-8-4 passed 00:07:46
version-service-8-4 passed 00:21:10
Summary Value
Tests Run 81/81
Job Duration 02:52:41
Total Test Time 19:18:29

commit: 5d4cbe9
image: perconalab/percona-server-mysql-operator:PR-1489-5d4cbe95

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

Labels

build size/L 100-499 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants