Skip to content

Suppress storage discrepancy error if external volume autoscaling is enabled #1897

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

terryyanko
Copy link

@terryyanko terryyanko commented Apr 25, 2025

CHANGE DESCRIPTION

Problem:
If using an external volume autoscaler for dynamic PVC resizing, the operator continually throws the below error if the volume is scaled beyond its initial spec.

requested storage is less than actual storage

Cause:
The operator is not currently aware of whether or not an external autoscaler is in use

Solution:
Provide an option to allow for external volume autoscaling

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

@CLAassistant
Copy link

CLAassistant commented Apr 25, 2025

CLA assistant check
All committers have signed the CLA.

@egegunes egegunes added this to the v1.21.0 milestone Apr 30, 2025
@@ -216,7 +216,11 @@ func (r *ReconcilePerconaServerMongoDB) resizeVolumesIfNeeded(ctx context.Contex
}

if requested.Cmp(actual) < 0 {
return errors.Errorf("requested storage (%s) is less than actual storage (%s)", requested.String(), actual.String())
if !cr.Spec.ExternalVolumeAutoscaling {
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIU operator should not care about PVCs at all if this is enabled, am I right @terryyanko? If yes, we can early return at the top of the function if this enabled.

ExternalVolumeAutoscaling might be disabled after an external autoscaler scales PVCs, we need to make sure this function covers that scenario.

Copy link
Author

Choose a reason for hiding this comment

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

@egegunes Yeah good point. I was thinking the user may still want direct control over the PVC size (even with this option enabled) after the initial deploy if, for example, they wanted to scale the volume beyond the current size as determined by the autoscaler. That probably isn't a common use case though. I'll move it up per your suggestion.

@JNKPercona
Copy link
Collaborator

Test name Status
arbiter passed
balancer passed
cross-site-sharded passed
custom-replset-name passed
custom-tls passed
custom-users-roles passed
custom-users-roles-sharded passed
data-at-rest-encryption passed
data-sharded passed
demand-backup passed
demand-backup-eks-credentials-irsa passed
demand-backup-fs passed
demand-backup-incremental passed
demand-backup-incremental-sharded passed
demand-backup-physical passed
demand-backup-physical-sharded passed
demand-backup-sharded passed
expose-sharded passed
finalizer passed
ignore-labels-annotations passed
init-deploy failure
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
multi-storage failure
non-voting passed
one-pod passed
operator-self-healing-chaos passed
pitr passed
pitr-physical passed
pitr-sharded passed
pitr-physical-backup-source 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 59 out of 59

commit: 4c34e71
image: perconalab/percona-server-mongodb-operator:PR-1897-4c34e718

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.

4 participants