-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Cluster Scalability
-
ALL
-
ClusterScalability Mar31-Apr14
-
None
-
None
-
None
-
None
-
None
-
None
-
None
The forceRedistribution is meant for redistributing the collection to different set of shards without changing the shard key pattern. It should assert that the command is not trying to use a different shard key pattern from the original collection but instead it reshards to the new shard key provided in the command.
Steps to reproduce:
Shard a collection sh.shardCollection("test.foo", {_id:1}) Reshard using forceRedistribution but different shard key Atlas [mongos] test> db.adminCommand({ reshardCollection: "test.foo", key: { region_id: "hashed" },numInitialChunks: 1, forceRedistribution: true }) { ok: 1, '$clusterTime': { clusterTime: Timestamp({ t: 1740780760, i: 14 }), signature: { hash: Binary.createFromBase64('ZS63GdxYKnuuF3+hOEqsh+5t9H8=', 0), keyId: Long('7475578754090139671') } }, operationTime: Timestamp({ t: 1740780760, i: 14 }) } Resharding reports success. sh.status() output post resharding: collections: { 'test.foo': { shardKey: { region_id: 'hashed' }, unique: false, balancing: true, chunkMetadata: [ { shard: 'atlas-gsohzn-shard-0', nChunks: 1 } ], chunks: [ { min: { region_id: MinKey() }, max: { region_id: MaxKey() }, 'on shard': 'atlas-gsohzn-shard-0', 'last modified': Timestamp({ t: 1, i: 4 }) } ], tags: [ { tag: 'NewZone', min: { region_id: MinKey() }, max: { region_id: MaxKey() } } ] }