-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.1.5
-
Component/s: None
-
Query Execution
-
ALL
mongos> db.adminCommand({ enableSharding: 'test' }) mongos> db.adminCommand({ shardCollection: 'test.user', key: { x: 1 }}) mongos> db.user.insert({ x: MaxKey }) WriteCommandError({ "ok" : 0, "errmsg" : "Cannot target single shard using key { x: MaxKey }", "code" : 61, "codeName" : "ShardKeyNotFound", "operationTime" : Timestamp(1542658417, 1), "$clusterTime" : { "clusterTime" : Timestamp(1542658417, 1), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } } })
This could be a potential edge case where { x: MaxKey } was inserted before collection was sharded and it would practically be invisible to the sharded cluster (since chunk upper bound is exclusive and migrations and versioned queries will ignore it).
- related to
-
SERVER-67529 Resharding silently skips documents with all MaxKey values for their fields under the new shard key pattern
- Closed