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

6.0.x Enterprise Advanced: sharded databases always shows "partitioned: false"

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 6.0.9
    • Component/s: None
    • Labels:
      None
    • Sharding EMEA
    • ALL
    • Hide

      MongoDB 6.0.9 Enterprise Advanced (EA) used

      (other 6.0.x versions also have same issue - maybe all?)

      Run:
      db.runCommand( { buildInfo: 1 } ).version 
      6.0.9
      db.runCommand( { buildInfo: 1 } ).modules 
      [ 'enterprise' ]
      
      
      

       

      Run:
      sh.shardCollection("foobar.transmissions", {"pzone":1, "transmission_id":1}, {"unique":true})
      Output:
      {
        collectionsharded: 'foobar.transmissions',
        ok: 1,
        '$clusterTime': {
          clusterTime: Timestamp({ t: 1691633612, i: 12 }),
          signature: {
            hash: Binary(Buffer.from("0000000000000000000000000000000000000000", "hex"), 0),
            keyId: Long("0")
          }
        },
        operationTime: Timestamp({ t: 1691633612, i: 8 })
      }
      
      
      

       

      Run:
      db.getSiblingDB('config').databases.find()
      Output: (showing "partitioned: false" even though a collection in that database has just been sharded)
       [
        {
          _id: 'foobar',
          primary: 'shard03',
          partitioned: false,
          version: {
            uuid: new UUID("12c22472-03f8-495f-809e-321abbdd8def"),
            timestamp: Timestamp({ t: 1691632589, i: 1 }),
            lastMod: 1
          }
        }
      ]
      
      
      

       

      Run:
      db.getSiblingDB('config').databases.find({partitioned: true})
      Output: 
      (FYI: Nothing is returned by the command which is saying NO databases are partitioned)
      
      
      

       

       

       

      Show
      MongoDB 6.0.9 Enterprise Advanced (EA) used (other 6.0.x versions also have same issue - maybe all?) Run: db.runCommand( { buildInfo: 1 } ).version 6.0.9 db.runCommand( { buildInfo: 1 } ).modules [ 'enterprise' ]   Run: sh.shardCollection( "foobar.transmissions" , { "pzone" :1, "transmission_id" :1}, { "unique" : true }) Output: {   collectionsharded: 'foobar.transmissions' ,   ok: 1,   '$clusterTime' : {     clusterTime: Timestamp({ t: 1691633612, i: 12 }),     signature: {       hash: Binary(Buffer.from( "0000000000000000000000000000000000000000" , "hex" ), 0),       keyId: Long ( "0" )     }   },   operationTime: Timestamp({ t: 1691633612, i: 8 }) }   Run: db.getSiblingDB( 'config' ).databases.find() Output: (showing "partitioned: false " even though a collection in that database has just been sharded) [   {     _id: 'foobar' ,     primary: 'shard03' ,     partitioned: false ,     version: {       uuid: new UUID( "12c22472-03f8-495f-809e-321abbdd8def" ),       timestamp: Timestamp({ t: 1691632589, i: 1 }),       lastMod: 1     }   } ]   Run: db.getSiblingDB( 'config' ).databases.find({partitioned: true }) Output: (FYI: Nothing is returned by the command which is saying NO databases are partitioned)      
    • Sharding EMEA 2023-08-21

      I understand that enableSharding() for a database is not required in 6.0; However, sharded databases are always showing "partitioned: false" in sh.status(). 

      Regardless of whether a database is enabled for sharding explicitly by enableSharding(<dbname>) (which isn't required as mentioned earlier) or by directly sharding the database.collection as described here: https://www.mongodb.com/docs/manual/reference/method/sh.shardCollection/#sh.shardcollection--

      The database reports is always reporting "partitioned: false" in sh.status().

      Having a database reporting "partitioned: false" when it has actually been sharded prevents some commands from reporting correctly such as:

      1) Finding what databases are actually sharded:

      db.getSiblingDB('config').databases.find({partitioned: true})

      2) Finding number of bytes in unsharded collections across the cluster as shown in this Knowledge Base article:
      https://kb.corp.mongodb.com/article/000018993

       

      Assuming this is a bug.

            Assignee:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Reporter:
            gary.taylor@mongodb.com Gary Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: