Skip to content
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

Not able to remove a shard in MongoDB Server version 8 #1870

Open
enrico-rabeneck opened this issue Mar 19, 2025 · 0 comments
Open

Not able to remove a shard in MongoDB Server version 8 #1870

enrico-rabeneck opened this issue Mar 19, 2025 · 0 comments
Labels

Comments

@enrico-rabeneck
Copy link

Report

Not possible to remove a shard in a multi sharded cluster in since MongoDB server version 8.

More about the problem

We have a running test cluster with two shards rs0 and rs1. When updating the cr.yaml without the rs1 configuration the following error is thrown:

2025-03-19T13:27:40.154Z ERROR Reconciler error {"controller": "psmdb-controller", "controllerGroup": "psmdb.percona.com", "controllerKind": "PerconaServerMongoDB", "PerconaServerMongoDB": {"name":"cluster-psmdb-db","namespace":"my-cluster-name"}, "namespace": "my-cluster-name", "name": "cluster-psmdb-db", "reconcileID": "863409b3-0d63-4edc-8fba-8aab8a8014f6", "error": "check remove posibility for rs rs1: failed to list databases for rs rs1: listDatabases: (Unauthorized) You are connecting to a sharded cluster improperly by connecting directly to a shard. Please connect to the cluster via a router (mongos).", "errorVerbose": "(Unauthorized) You are connecting to a sharded cluster improperly by connecting directly to a shard. Please connect to the cluster via a router (mongos).\nlistDatabases\ngithub.com/percona/percona-server-mongodb-operator/pkg/psmdb/mongo.(*mongoClient).ListDBs\n\t/go/src/github.com/percona/percona-server-mongodb-operator/pkg/psmdb/mongo/mongo.go:490\ngithub.com/percona/percona-server-mongodb-operator/pkg/controller/perconaservermongodb. [...]

Expectation:
The shard rs1 is removed.

Steps to reproduce

  1. Create a sharded cluster with at least two shards.
  2. Remove one shard from the configuration.

Versions

  1. Kubernetes: AWS EKS 1.32
  2. Operator: 1.19.1
  3. Database: percona-server-mongodb:8.0.4-2

Anything else?

Not possible to change system-level users to add the missing privilege directShardOperations

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

No branches or pull requests

1 participant