Skip to content

K8SPSMDB-1276: Optimize TLS and CA certificate file writes in getMongoUri function #1736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 28, 2025

Conversation

clsv
Copy link
Contributor

@clsv clsv commented Nov 23, 2024

K8SPSMDB-1276 Powered by Pull Request Badge

Problem:
The function getMongoUri always rewrites the TLS PEM and CA certificate files, even if their content hasn't changed. This unnecessary file I/O is inefficient and may cause issues during critical operations, such as when the operator checks the backup process.

Cause:
The implementation does not verify whether the existing file content matches the secret data before overwriting the files, leading to constant and redundant updates.

Solution:
Added logic to compare the content of the existing files with the secret data. Files are only overwritten if the data has changed, preventing redundant writes and ensuring smoother operations during backup checks.

Resolves #1723

@it-percona-cla
Copy link

it-percona-cla commented Dec 4, 2024

CLA assistant check
All committers have signed the CLA.

@egegunes egegunes added this to the v1.20.0 milestone Jan 13, 2025
@egegunes egegunes changed the title Optimize TLS and CA certificate file writes in getMongoUri function K8SPSMDB-1276: Optimize TLS and CA certificate file writes in getMongoUri function Feb 10, 2025
@JNKPercona
Copy link
Collaborator

Test name Status
arbiter passed
balancer passed
custom-replset-name passed
custom-tls passed
custom-users-roles passed
custom-users-roles-sharded passed
cross-site-sharded passed
data-at-rest-encryption passed
data-sharded passed
demand-backup passed
demand-backup-fs passed
demand-backup-eks-credentials-irsa passed
demand-backup-physical passed
demand-backup-physical-sharded passed
demand-backup-sharded passed
expose-sharded passed
ignore-labels-annotations passed
init-deploy passed
finalizer passed
ldap passed
ldap-tls passed
limits passed
liveness passed
mongod-major-upgrade passed
mongod-major-upgrade-sharded passed
monitoring-2-0 passed
multi-cluster-service passed
non-voting passed
one-pod passed
operator-self-healing-chaos passed
pitr passed
pitr-sharded passed
pitr-physical passed
preinit-updates passed
pvc-resize passed
recover-no-primary passed
replset-overrides passed
rs-shard-migration passed
scaling passed
scheduled-backup passed
security-context passed
self-healing-chaos passed
service-per-pod passed
serviceless-external-nodes passed
smart-update passed
split-horizon passed
stable-resource-version passed
storage passed
tls-issue-cert-manager passed
upgrade passed
upgrade-consistency passed
upgrade-consistency-sharded-tls passed
upgrade-sharded passed
users passed
version-service passed
We run 55 out of 55

commit: b36c534
image: perconalab/percona-server-mongodb-operator:PR-1736-b36c5346

@hors hors merged commit 3f5431a into percona:main Feb 28, 2025
11 of 15 checks passed
@hors
Copy link
Collaborator

hors commented Feb 28, 2025

@clsv, thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error status on successful backups due to certificate retrieval issue
9 participants