Description:
We have these settings on prod cluster:
updateStrategy: SmartUpdate
upgradeOptions:
versionServiceEndpoint: https://check.percona.com
apply: disabled
schedule: "0 4 * * *"
enableCRValidationWebhook: false
And occasionally smartupdate is triggered with no apparent reason.
Steps to Reproduce:
It happens at random
Version:
8.0.32-24.2
Logs:
2024-05-28T04:01:55+02:00 {"level":"info","ts":1716861715.9441552,"logger":"perconaxtradbcluster","caller":"pxc/version.go:61","msg":"add new job","cluster":"pxc-db","namespace":"percona","schedule":"0 4 * * *"}
2024-05-28T04:01:55+02:00 {"level":"info","ts":1716861715.9442644,"logger":"perconaxtradbcluster","caller":"pxc/version.go:103","msg":"add new job","cluster":"pxc-db","namespace":"percona","name":"ensure-version/percona/pxc-db","schedule":"0 4 * * *"}
2024-05-29T11:46:17+02:00 [mysql] 2024/05/29 09:46:17 packets.go:37: unexpected EOF
2024-05-29T21:17:36+02:00 2024-05-29T19:17:36.192Z ERROR Reconciler error {"controller": "perconaxtradbcluster-controller", "object": {"name":"pxc-db","namespace":"percona"}, "namespace": "percona", "name": "pxc-db", "reconcileID": "ada5f6e3-69b1-4784-8452-f92f80836669", "error": "reconcile users: manage sys users: is old password discarded: select User_attributes field: dial tcp: lookup pxc-db-pxc-unready.percona on 10.43.0.10:53: no such host", "errorVerbose": "dial tcp: lookup pxc-db-pxc-unready.percona on 10.43.0.10:53: no such host\nselect User_attributes field\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/pxc/users.(*Manager).IsOldPassDiscarded\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/pxc/users/users.go:172\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).isOldPasswordDiscarded\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/users.go:1017\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).handleClustercheckUser\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/users.go:584\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).updateUsers\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/users.go:169\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).reconcileUsers\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/users.go:107\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).Reconcile\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/controller.go:295\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:121\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:320\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:273\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:234\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1594\nis old password discarded\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).isOldPasswordDiscarded\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/users.go:1019\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).handleClustercheckUser\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/users.go:584\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).updateUsers\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/users.go:169\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).reconcileUsers\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/users.go:107\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).Reconcile\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/controller.go:295\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:121\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:320\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:273\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:234\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1594\nmanage sys users\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).reconcileUsers\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/users.go:109\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).Reconcile\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/controller.go:295\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:121\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:320\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:273\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:234\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1594\nreconcile users\ngithub.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc.(*ReconcilePerconaXtraDBCluster).Reconcile\n\t/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxc/controller.go:297\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:121\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:320\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:273\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:234\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1594"}
2024-05-29T21:17:36+02:00 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
2024-05-29T21:17:36+02:00 /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:326
2024-05-29T21:17:36+02:00 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
2024-05-29T21:17:36+02:00 /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:273
2024-05-29T21:17:36+02:00 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
2024-05-29T21:17:36+02:00 /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:234
2024-05-31T16:41:52+02:00 {"level":"info","ts":1717166512.725894,"logger":"perconaxtradbcluster","caller":"pxc/upgrade.go:267","msg":"statefulSet was changed, run smart update","cluster":"pxc-db","namespace":"percona"}
2024-05-31T16:41:52+02:00 {"level":"info","ts":1717166512.7617571,"logger":"perconaxtradbcluster","caller":"pxc/upgrade.go:295","msg":"primary pod","cluster":"pxc-db","namespace":"percona","pod name":"pxc-db-pxc-0.pxc-db-pxc.percona"}
2024-05-31T16:41:52+02:00 {"level":"info","ts":1717166512.761869,"logger":"perconaxtradbcluster","caller":"pxc/upgrade.go:312","msg":"apply changes to secondary pod","cluster":"pxc-db","namespace":"percona","pod name":"pxc-db-pxc-2"}
2024-05-31T16:42:52+02:00 {"level":"info","ts":1717166572.9808805,"logger":"perconaxtradbcluster","caller":"pxc/upgrade.go:590","msg":"pod is running","cluster":"pxc-db","namespace":"percona","pod name":"pxc-db-pxc-2"}
2024-05-31T16:42:52+02:00 {"level":"info","ts":1717166572.9911234,"logger":"perconaxtradbcluster","caller":"pxc/upgrade.go:312","msg":"apply changes to secondary pod","cluster":"pxc-db","namespace":"percona","pod name":"pxc-db-pxc-1"}
2024-05-31T16:44:13+02:00 {"level":"info","ts":1717166653.1513507,"logger":"perconaxtradbcluster","caller":"pxc/upgrade.go:590","msg":"pod is running","cluster":"pxc-db","namespace":"percona","pod name":"pxc-db-pxc-1"}
2024-05-31T16:44:13+02:00 {"level":"info","ts":1717166653.1639895,"logger":"perconaxtradbcluster","caller":"pxc/upgrade.go:319","msg":"apply changes to primary pod","cluster":"pxc-db","namespace":"percona","pod name":"pxc-db-pxc-0"}
2024-05-31T16:45:23+02:00 {"level":"info","ts":1717166723.3564456,"logger":"perconaxtradbcluster","caller":"pxc/upgrade.go:590","msg":"pod is running","cluster":"pxc-db","namespace":"percona","pod name":"pxc-db-pxc-0"}
2024-05-31T16:45:23+02:00 {"level":"info","ts":1717166723.365791,"logger":"perconaxtradbcluster","caller":"pxc/upgrade.go:324","msg":"smart update finished","cluster":"pxc-db","namespace":"percona"}
Expected Result:
MySQL should have no downtime
Actual Result:
PXC pods are restarted one by one
Additional Information:
Our Laravel PHP app has the error “SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”