Skip to content

Conversation

@kamil-holubicki
Copy link
Contributor

@kamil-holubicki kamil-holubicki commented Mar 14, 2025

K8SPXC-1327 Powered by Pull Request Badge

https://perconadev.atlassian.net/browse/K8SPXC-1327

Problem:
By default, standard libc allocator is used by PXC. It is often desirable to use jemalloc instead. To do so, use has to configure LD_PRELOAD environment variable. The only way to do this is through k8s secret.

Solution:
Extended PodSpec object with MySqlAllocator property. If it is empty, omitted or set to 'jemalloc', LD_PRELOAD env variable pointing to jemalloc library will be exported.
Otherwise the default allocator will be used.

CHANGE DESCRIPTION

Problem:
Short explanation of the problem.

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?

https://perconadev.atlassian.net/browse/K8SPXC-1327

Problem:
By default, standard libc allocator is used by PXC. It is often
desirable to use jemalloc instead. To do so, use has to configure
LD_PRELOAD environment variable. The only way to do this is through
k8s secret.

Solution:
Extended PodSpec object with MySqlAllocator property. If it is empty,
omitted or set to 'jemalloc', LD_PRELOAD env variable pointing
to jemalloc library will be exported.
Otherwise the default allocator will be used.
@it-percona-cla
Copy link

it-percona-cla commented Mar 14, 2025

CLA assistant check
All committers have signed the CLA.

@pull-request-size pull-request-size bot added the size/L 100-499 lines label Mar 14, 2025
@kamil-holubicki kamil-holubicki requested review from egegunes and removed request for egegunes March 14, 2025 14:43
deploy/cr.yaml Outdated
size: 3
image: perconalab/percona-xtradb-cluster-operator:main-pxc8.0
autoRecovery: true
# mySqlAllocator: jemalloc
Copy link
Collaborator

Choose a reason for hiding this comment

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

In cr we have a commented option with a default value. In our doc, we will add all possible values. Also, you can add them in CRD. It is possible to add validation on CRD level.

Copy link
Contributor Author

@kamil-holubicki kamil-holubicki Mar 17, 2025

Choose a reason for hiding this comment

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

In cr we have a commented option with a default value. In our doc, we will add all possible values.

Done

Also, you can add them in CRD. It is possible to add validation on CRD level.

I'm not sure I understand where and what to add.

Copy link
Contributor

Choose a reason for hiding this comment

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

validation rules are defined using comments called kubebuilder markers: https://book.kubebuilder.io/reference/markers/crd-validation

for example:

-       MySQLAllocator                string                        `json:"mysqlAllocator,omitempty"`
+
+       // +kubebuilder:validation:Required
+       // +kubebuilder:validation:Enum={jemalloc,tcmalloc}
+       // +kubebuilder:default=jemalloc
+       MySQLAllocator string `json:"mysqlAllocator,omitempty"`

afterwards you need to regenerate manifests: make generate manifests VERSION=main (do this after merging main and fixing conflicts)

@pull-request-size pull-request-size bot added size/M 30-99 lines and removed size/L 100-499 lines labels Mar 17, 2025
egegunes
egegunes previously approved these changes Mar 28, 2025
@egegunes egegunes modified the milestones: v1.17.0, v1.18.0 Mar 28, 2025
gkech
gkech previously approved these changes Mar 31, 2025
@hors hors modified the milestones: v1.18.0, v1.19.0 Jul 29, 2025
}...)
}

if cr.CompareVersionWith("1.18.0") >= 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

we need to change this version to 1.19.0 since 1.18.0 is already released

@JNKPercona
Copy link
Collaborator

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

commit: 4292959
image: perconalab/percona-xtradb-cluster-operator:PR-2002-42929599

@gkech
Copy link
Contributor

gkech commented Nov 4, 2025

please also have a look on the unit tests cause they are failing due to the proposed changes. 🙏🏽

@egegunes egegunes marked this pull request as draft November 6, 2025 05:39
@egegunes
Copy link
Contributor

egegunes commented Nov 6, 2025

I'll address comments and fix tests

@egegunes egegunes self-assigned this Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M 30-99 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants