Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-44052

Inconsistencies in sharded collections

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Incomplete
    • Affects Version/s: 4.0.2, 4.0.4, 4.0.5
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL

      Description

      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)

       

       

        Attachments

        1. alerts_20191030_stats.txt
          73 kB
        2. shardcolcreation.txt
          2 kB

          Issue Links

            Activity

              People

              Assignee:
              carl.champain Carl Champain (Inactive)
              Reporter:
              sadithela@assia-inc.com Stephen Paul Adithela
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: