-
Type: Bug
-
Resolution: Incomplete
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.0.2, 4.0.4, 4.0.5
-
Component/s: None
-
None
-
ALL
Mongos is reporting inconsistent information for sharded collections.
Our Setup:
A DB Cluster with three shards. Each shard has PSA Architecture. Three config servers.
Mongo Versions: 4.0.X
Scenario:
Mongos reports that collection alerts_20191026 is not sharded. But config.chunks reports that there are three chunks for that namespace that are in different shards
mongos> db.alerts_20191026.getShardDistribution()
Collection hitron.alerts_20191026 is not sharded.
mongos> use config
switched to db config
mongos> db.chunks.find({ns: "hitron.alerts_20191026"})
{ "_id" : "hitron.alerts_20191026-lineId_-3074457345618258602", "lastmod" : Timestamp(2, 0), "lastmodEpoch" : ObjectId("5da687c8a664d0a846cf713f"), "ns" : "hitron.alerts_20191026", "min" : \{ "lineId" : NumberLong("-3074457345618258602") }, "max" : { "lineId" : NumberLong("3074457345618258602") }, "shard" : "rs2", "history" : [ { "validAfter" : Timestamp(1571194825, 261), "shard" : "rs2" }, { "validAfter" : Timestamp(1571194824, 926), "shard" : "rs1" } ] }
{ "_id" : "hitron.alerts_20191026-lineId_3074457345618258602", "lastmod" : Timestamp(3, 0), "lastmodEpoch" : ObjectId("5da687c8a664d0a846cf713f"), "ns" : "hitron.alerts_20191026", "min" : \{ "lineId" : NumberLong("3074457345618258602") }, "max" : { "lineId" : { "$maxKey" : 1 } }, "shard" : "rs3", "history" : [ { "validAfter" : Timestamp(1571194825, 616), "shard" : "rs3" }, { "validAfter" : Timestamp(1571194824, 926), "shard" : "rs1" } ] }
{ "_id" : "hitron.alerts_20191026-lineId_MinKey", "lastmod" : Timestamp(3, 1), "lastmodEpoch" : ObjectId("5da687c8a664d0a846cf713f"), "ns" : "hitron.alerts_20191026", "min" : { "lineId" : { "$minKey" : 1 } }, "max" : { "lineId" : NumberLong("-3074457345618258602") }, "shard" : "rs1", "history" : [ { "validAfter" : Timestamp(1571194824, 926), "shard" : "rs1" } ] }
mongos> db.alerts_20191026.stats().nchunks
1
mongos> sh.status()
hitron.alerts_20191026
shard key: { "lineId" : "hashed" }
unique: false
balancing: true
chunks:
rs1 1
rs2 1
rs3 1
{ "lineId" : { "$minKey" : 1 } } -->> { "lineId" : NumberLong("-3074457345618258602") } on : rs1 Timestamp(3, 1)
{ "lineId" : NumberLong("-3074457345618258602") } -->> { "lineId" : NumberLong("3074457345618258602") } on : rs2 Timestamp(2, 0)
{ "lineId" : NumberLong("3074457345618258602") } -->> { "lineId" : { "$maxKey" : 1 } } on : rs3 Timestamp(3, 0)
- duplicates
-
SERVER-32198 Missing collection metadata on the shard implies both UNSHARDED and "metadata not loaded yet"
- Closed
- is related to
-
SERVER-5160 Handle all failed shardCollection commands well
- Closed
- related to
-
SERVER-43689 getShardDistribution() incorrectly shows 0 chunks
- Closed