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

shardCollection doesn't preserve "noBalance" and "permitMigrations" fields

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL

      Consider a tracked unsharded collection has run st.disableBalancing() to set "noBalance" to true, and setAllowMigrations command to set "permitMigrations" to false.

      Here is the config.collections document before running shardCollection command:

      {
      	"_id" : "testDb.testColl",
      	"lastmodEpoch" : ObjectId("66cca0b34f42cd3a2d1f3ce9"),
      	"lastmod" : ISODate("2024-08-26T15:35:15.881Z"),
      	"timestamp" : Timestamp(1724686515, 122),
      	"uuid" : UUID("e3359459-293a-4eef-8af6-53e76b8fd3b2"),
      	"key" : {
      		"_id" : 1
      	},
      	"unique" : false,
      	"noBalance" : true,
      	"unsplittable" : true,
      	"permitMigrations" : false
      }
      

      Here is the config.collections document after running shardCollection command:

      {
      	"_id" : "testDb.testColl",
      	"lastmodEpoch" : ObjectId("66cca0b34f42cd3a2d1f3cf0"),
      	"lastmod" : ISODate("2024-08-26T15:35:16.007Z"),
      	"timestamp" : Timestamp(1724686515, 162),
      	"uuid" : UUID("e3359459-293a-4eef-8af6-53e76b8fd3b2"),
      	"key" : {
      		"_id" : 1
      	},
      	"unique" : false,
      	"noBalance" : false
      }
      

      This shouldn't have any user impact at the moment since the shardCollection command are only supported against unsharded collections. Until we do SPM-3338, users are unlikely to intentionally run st.disableBalancing() against an unsharded collection.

            Assignee:
            Unassigned Unassigned
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: