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

reshardCollection allowed on config.system.sessions via mongos with config shard

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Sharding NYC
    • Fully Compatible
    • ALL
    • Hide

      1) Setup a 2 shard config shard cluster

      2) Run the following command via mongos

      db.adminCommand({reshardCollection: "config.system.sessions", key: {uid: 1}, numInitialChunks: 2})  
      Show
      1) Setup a 2 shard config shard cluster 2) Run the following command via mongos db.adminCommand({reshardCollection: "config.system.sessions" , key: {uid: 1}, numInitialChunks: 2})
    • Sharding NYC 2023-04-03, Sharding NYC 2023-04-17

      On CSRS, an attempt to run reshardCollection on config.system.sessions fails:

      mongos> db.adminCommand({reshardCollection: "config.system.sessions", key: {uid: 1}, numInitialChunks: 2})
      {
      	"ok" : 0,
      	"errmsg" : "Cannot accept sharding commands if not started with --shardsvr",
      	"code" : 193,
      	"codeName" : "NoShardingEnabled",
      	"$clusterTime" : {
      		"clusterTime" : Timestamp(1678464167, 1),
      		"signature" : {
      			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
      			"keyId" : NumberLong(0)
      		}
      	},
      	"operationTime" : Timestamp(1678464167, 1)
      } 

      With a config shard configuration, it is allowed and appears to hang:

      mongos> db.adminCommand({reshardCollection: "config.system.sessions", key: {uid: 1}, numInitialChunks: 2}) 

      The following log messages are printed every 10 seconds in the config shard mongod.log file. Note the balancer error: "Unable to enforce zone range policy for collection" / "Expected collection config.system.resharding.edad0981-4f37-4de4-a52c-1a1b117a5ac9 to be sharded"

      {"t":{"$date":"2023-03-10T11:06:37.536-05:00"},"s":"I",  "c":"SH_REFR",  "id":4619902, "ctx":"CatalogCache-4","msg":"Collection has found to be unsharded after refresh","attr":{"namespace":"config.system.resharding.edad0981-4f37-4de4-a52c-1a1b117a5ac9","durationMillis":0}}
      {"t":{"$date":"2023-03-10T11:06:37.536-05:00"},"s":"W",  "c":"SHARDING", "id":21852,   "ctx":"Balancer","msg":"Unable to enforce zone range policy for collection","attr":{"namespace":"config.system.resharding.edad0981-4f37-4de4-a52c-1a1b117a5ac9","error":{"code":118,"codeName":"NamespaceNotSharded","errmsg":"Expected collection config.system.resharding.edad0981-4f37-4de4-a52c-1a1b117a5ac9 to be sharded"}}}
      {"t":{"$date":"2023-03-10T11:06:37.539-05:00"},"s":"I",  "c":"SH_REFR",  "id":4619901, "ctx":"CatalogCache-4","msg":"Refreshed cached collection","attr":{"namespace":"config.system.sessions","lookupSinceVersion":"1|1029||640a3ba7530410d994f8fe59||Timestamp(1678392231, 9)","newVersion":"{ chunkVersion: { e: ObjectId('640a3ba7530410d994f8fe59'), t: Timestamp(1678392231, 9), v: Timestamp(1, 1029) }, forcedRefreshSequenceNum: 7839, epochDisambiguatingSequenceNum: 7840 }","timeInStore":"{ chunkVersion: \"None\", forcedRefreshSequenceNum: 7838, epochDisambiguatingSequenceNum: 7839 }","durationMillis":2}}
      {"t":{"$date":"2023-03-10T11:06:37.550-05:00"},"s":"I",  "c":"SH_REFR",  "id":4619901, "ctx":"CatalogCache-4","msg":"Refreshed cached collection","attr":{"namespace":"config.system.sessions","lookupSinceVersion":"1|1029||640a3ba7530410d994f8fe59||Timestamp(1678392231, 9)","newVersion":"{ chunkVersion: { e: ObjectId('640a3ba7530410d994f8fe59'), t: Timestamp(1678392231, 9), v: Timestamp(1, 1029) }, forcedRefreshSequenceNum: 7841, epochDisambiguatingSequenceNum: 7842 }","timeInStore":"{ chunkVersion: \"None\", forcedRefreshSequenceNum: 7840, epochDisambiguatingSequenceNum: 7841 }","durationMillis":1}}
      

            Assignee:
            wenqin.ye@mongodb.com Wenqin Ye
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: