Skip to content

Conversation

@nmarukovich
Copy link
Contributor

@nmarukovich nmarukovich commented Nov 20, 2025

K8SPXC-992 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
Currently the binlog collector renames binlog files to something like "binlog_1649235295_ad36c3caac21832e0b1f4e08fbdca564". The timestamp comes from get_first_record_timestamp_by_binlog UDF described in doc
and "ad36c3caac21832e0b1f4e08fbdca564" is the md5 hash of the GTID set.

This can lead to having two binlogs with same timestamp (due to a small value for max_binlog_size, starting multiple big transactions at the same time etc.) and make ordering the logs impossible.

To fix the issue we'll preserve the incremental number from the file name and have filename like this: "binlog_1649235295_000001_ad36c3caac21832e0b1f4e08fbdca564"

In the task we update the binlog name that we send to storage.

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
Short explanation of the solution we are providing with this PR.

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?

@pull-request-size pull-request-size bot added the size/S 10-29 lines label Nov 20, 2025
@nmarukovich nmarukovich marked this pull request as ready for review November 21, 2025 11:46
"context"
"crypto/md5"
"fmt"
"golang.org/x/sys/unix"
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs to be in 2nd import group

Comment on lines 24 to 25
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
Copy link
Contributor

Choose a reason for hiding this comment

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

these need to be in 2nd import group

@egegunes
Copy link
Contributor

@nmarukovich please add description to your PR

…ona/percona-xtradb-cluster-operator into K8SPXC-992_prevent_binlog_collision
@nmarukovich nmarukovich requested a review from egegunes November 24, 2025 12:53
@JNKPercona
Copy link
Collaborator

Test Name Result Time
auto-tuning-8-0 passed 00:18:22
allocator-8-0 passed 00:12:38
backup-storage-tls-8-0 passed 00:23:02
cross-site-8-0 passed 00:34:05
custom-users-8-0 passed 00:11:59
demand-backup-cloud-8-0 passed 00:56:11
demand-backup-encrypted-with-tls-8-0 passed 00:45:55
demand-backup-8-0 passed 00:41:34
demand-backup-flow-control-8-0 passed 00:10:14
demand-backup-parallel-8-0 passed 00:08:53
demand-backup-without-passwords-8-0 passed 00:15:43
haproxy-5-7 passed 00:13:51
haproxy-8-0 passed 00:14:31
init-deploy-5-7 passed 00:16:32
init-deploy-8-0 passed 00:16:07
limits-8-0 passed 00:12:21
monitoring-2-0-8-0 passed 00:22:18
monitoring-pmm3-8-0 passed 00:17:50
one-pod-5-7 passed 00:14:31
one-pod-8-0 passed 00:13:32
pitr-8-0 passed 00:48:02
pitr-gap-errors-8-0 passed 00:55:49
proxy-protocol-8-0 passed 00:09:32
proxysql-sidecar-res-limits-8-0 passed 00:08:20
proxysql-scheduler-8-0 passed 00:15:59
pvc-resize-5-7 passed 00:14:51
pvc-resize-8-0 passed 00:15:40
recreate-8-0 passed 00:17:00
restore-to-encrypted-cluster-8-0 passed 00:25:34
scaling-proxysql-8-0 passed 00:08:12
scaling-8-0 passed 00:10:42
scheduled-backup-5-7 passed 01:03:46
scheduled-backup-8-0 passed 01:01:49
security-context-8-0 passed 00:25:07
smart-update1-8-0 passed 00:35:58
smart-update2-8-0 passed 00:37:59
storage-8-0 passed 00:10:31
tls-issue-cert-manager-ref-8-0 passed 00:08:35
tls-issue-cert-manager-8-0 passed 00:11:16
tls-issue-self-8-0 passed 00:13:01
upgrade-consistency-8-0 passed 00:11:11
upgrade-haproxy-5-7 passed 00:24:17
upgrade-haproxy-8-0 passed 00:26:30
upgrade-proxysql-5-7 passed 00:14:01
upgrade-proxysql-8-0 passed 00:16:29
users-5-7 passed 00:24:33
users-8-0 passed 00:25:51
validation-hook-8-0 passed 00:01:32
Summary Value
Tests Run 48/48
Job Duration 02:50:31
Total Test Time 17:42:37

commit: a2c7ae0
image: perconalab/percona-xtradb-cluster-operator:PR-2260-a2c7ae05

@hors hors merged commit 9de3472 into main Nov 25, 2025
16 checks passed
@hors hors deleted the K8SPXC-992_prevent_binlog_collision branch November 25, 2025 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S 10-29 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants