Uploaded image for project: 'Percona Operator for MongoDB'
  1. Percona Operator for MongoDB
  2. K8SPSMDB-563

Can't reduce replicaset size with delete psmdb and cluster re-creation

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • 1.7.0, 1.10.0
    • 1.12.0
    • None
    • None
    • Yes

    Description

      Percona Kubernetes Operator for PSMDB removes all pods at once:

      [[email protected] percona-server-mongodb-operator]# kubectl delete -f deploy/cr.yaml
      perconaservermongodb.psmdb.percona.com "my-cluster-name" deleted
      [[email protected] percona-server-mongodb-operator]# kubectl get pods
      NAME                                               READY   STATUS        RESTARTS   AGE
      percona-server-mongodb-operator-58c459565b-zjkkv   1/1     Running       0          9m24s
      my-cluster-name-rs0-0                              2/2     Terminating   0          8m52s
      my-cluster-name-rs0-2                              2/2     Terminating   0          5m27s
      my-cluster-name-rs0-1                              2/2     Terminating   0          7m13s
      my-cluster-name-cfg-1                              2/2     Terminating   0          7m16s
      my-cluster-name-cfg-2                              2/2     Terminating   2          6m1s
      my-cluster-name-cfg-0                              2/2     Terminating   2          8m52s
      my-cluster-name-mongos-5747c7f4f7-b5spc            1/1     Terminating   0          5m
      my-cluster-name-mongos-5747c7f4f7-z8b5q            1/1     Terminating   0          5m
      my-cluster-name-mongos-5747c7f4f7-ljx8t            1/1     Terminating   0          5m
      
      

      after deleting psmdb resource, the user can reduce replicaset size down to 1 & allowUnsafeConfigurations: true.
      As a result the cluster can't transit to the PRIMARY state.

      The problem could be reproduced with both replicaset-only and sharded configuration.

      Suggested fix:
      always start with the "before shutdown" number of nodes or terminate replica set nodes one by one.

      Attachments

        Issue Links

          Activity

            People

              andrii.dema Andrii Dema
              nickolay.ihalainen Nickolay Ihalainen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist