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

Test that applyOps can clone admin.system.version preserving its UUID

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.6.1, 3.7.1
    • Storage
    • Fully Compatible
    • v3.6
    • Storage 2017-11-13, Storage 2017-12-04

    Description

      Cloud backup needs to be able to implement its version of initial sync that clones all databases preserving UUIDs, including admin.system.version. However, starting up mongod without data files will itself create the admin.system.version collection with a newly generated UUID. Backup uses the technique below to replace the collection with one preserving the UUID of the backup source.

      We need a test to ensure the following will keep working:

      • Use listCollections to note the UUID of the existing admin.system.version
      • Issue applyOps command:

        db.runCommand({
        	"applyOps" : [
        		{
        			"op" : "c",
        			"ns" : "admin.$cmd",
        			"ui" : UUID("deadbeef-8afe-4493-ac73-f2d521877a3b"), // <-- Your new UUID
        			"o" : {
        				"create" : "system.version"
        			}
        		},
        		{
        			"op" : "i",
        			"ns" : "admin.system.version",
        			"o" : {
        				"_id" : "featureCompatibilityVersion",
        				"version" : "3.6"
        			}
        		},
        		{
        			"op" : "c",
        			"ns" : "admin.$cmd",
        			"ui" : UUID("16f1fd0d-aa46-487e-b4c5-571ff5f1e385"), // <-- The UUID of the existing admin.system.version
        			"o" : {
        				"drop" : "admin.tmp_system_version" // <-- Just a placeholder name, doesn't have to be actual collection
        			}
        		}
        	]
        })
        

      Attachments

        Activity

          People

            xiangyu.yao@mongodb.com Xiangyu Yao (Inactive)
            geert.bosch@mongodb.com Geert Bosch
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: