Uploaded image for project: 'Percona Operator for MySQL based on Percona XtraDB Cluster'
  1. Percona Operator for MySQL based on Percona XtraDB Cluster
  2. K8SPXC-862

Changing resources might lead to cluster getting stuck

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • None
    • 1.11.0
    • None
    • None
    • Yes
    • Yes

    Description

      If the user sets requests or limits for CPU as integer it leads to an error when deploying the cluster:

      E0824 12:31:20.117833       1 reflector.go:178] sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go:224: Failed to list *v1.PerconaXtraDBCluster: v1.PerconaXtraDBClusterList.Items: []v1.PerconaXtraDBCluster: v1.PerconaXtraDBCluster.Spec: v1.PerconaXtraDBClusterSpec.PXC: v1.PXCSpec.PodSpec: Size: PodSpec: ServiceAccountName: PodSpec: Resources: v1.PodResources.Requests: v1.ResourcesList.Memory: CPU: ReadString: expects " or n, but found 1, error found in #10 byte of ...|":{"cpu":1,"memory":|..., bigger context ...|meoutSeconds":15},"resources":{"requests":{"cpu":1,"memory":"1G"}},"serviceAccountName":"default","s|...     

       

      Changing requests on already running cluster leads to the cluster and operator getting stuck.

       

      Steps to reproduce:

      1. Deploy the cluster with default CR
      2. Change spec.pxc.resources.requests.cpu to 1 (no quotes)
      3. See the error in the log
      E0824 12:31:20.117833       1 reflector.go:178] sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go:224: Failed to list *v1.PerconaXtraDBCluster: v1.PerconaXtraDBClusterList.Items: []v1.PerconaXtraDBCluster: v1.PerconaXtraDBCluster.Spec: v1.PerconaXtraDBClusterSpec.PXC: v1.PXCSpec.PodSpec: Size: PodSpec: ServiceAccountName: PodSpec: Resources: v1.PodResources.Requests: v1.ResourcesList.Memory: CPU: ReadString: expects " or n, but found 1, error found in #10 byte of ...|":{"cpu":1,"memory":|..., bigger context ...|meoutSeconds":15},"resources":{"requests":{"cpu":1,"memory":"1G"}},"serviceAccountName":"default","s|...                                                                                                                                                   {"level":"error","ts":1629808280.3450387,"caller":"zapr/zapr.go:128","msg":"Update status","error":"send update: Operation cannot be fulfilled on perconaxtradbclusters.pxc.percona.com \"cluster1\": the object has been modified; please apply your changes to the latest version and try again","errorVerbose":"Operation cannot be fulfilled on perconaxtradbclusters.pxc.percona.com \"cluster1\": the object has been modified; please apply your changes to the latest version and try again\nsend update 

      The cluster cannot be deleted now. 

      Changing resources to "correct" ones fixes the issue and the cluster can be operated again.

       

      Expected behavior

      1. I expect that I can set CPU and Memory the same way I do it for regular Kubernetes objects: both "1" and 1 work.

      2. I expect that the cluster does not get stuck and I can still delete it.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sergey.pronin Sergey Pronin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist