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

convertToCapped 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 convertToCapped command:

      {
       	"_id" : "testDb.testColl",
       	"lastmodEpoch" : ObjectId("66cca0c932712e26fa8c323b"),
       	"lastmod" : ISODate("2024-08-26T15:35:37.850Z"),
       	"timestamp" : Timestamp(1724686537, 257),
       	"uuid" : UUID("594d96bb-27a4-4432-9a1b-071e16c01eeb"),
       	"key" : {
       		"_id" : 1
       	},
       	"unique" : false,
       	"noBalance" : true,
       	"unsplittable" : true,
       	"permitMigrations" : false
      }
      

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

      {
       	"_id" : "testDb.testColl",
       	"lastmodEpoch" : ObjectId("66cca0c932712e26fa8c3243"),
       	"lastmod" : ISODate("2024-08-26T15:35:37.990Z"),
       	"timestamp" : Timestamp(1724686537, 316),
       	"uuid" : UUID("cd4fa81c-2827-431c-b75a-2590508c59e8"),
       	"key" : {
       		"_id" : 1
       	},
       	"unique" : false,
       	"noBalance" : false,
       	"unsplittable" : true
      }
      

      This shouldn't have any user impact at the moment since the convertToCapped 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:
            4 Start watching this issue

              Created:
              Updated: