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

Dropping admin db sets FCV to 3.4 but leaves UUIDs

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.6.0
    • 3.6.3, 3.7.2
    • Upgrade/Downgrade
    • None
    • Fully Compatible
    • ALL
    • v3.6
    • Hide

      The following shows how dropping the admin db may leave UUIDs.

      test> db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1})
      { "featureCompatibilityVersion" : { "version" : "3.6" }, "ok" : 1 }
      test> use local
      switched to db local
      local> db.runCommand({listCollections: 1})
      {
          "cursor" : {
              "id" : NumberLong(0),
              "ns" : "local.$cmd.listCollections",
              "firstBatch" : [
                  {
                      "name" : "startup_log",
                      "type" : "collection",
                      "options" : {
                          "capped" : true,
                          "size" : 10485760
                      },
                      "info" : {
                          "readOnly" : false,
                          "uuid" : BinData(4,"8Vlh0RQDSSy2HRFJJlBVDQ==")
                      },
                      "idIndex" : {
                          "v" : 2,
                          "key" : {
                              "_id" : 1
                          },
                          "name" : "_id_",
                          "ns" : "local.startup_log"
                      }
                  }
              ]
          },
          "ok" : 1
      }
      local> use admin
      switched to db admin
      admin> db.dropDatabase()
      { "dropped" : "admin", "ok" : 1 }
      admin> db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1})
      { "featureCompatibilityVersion" : { "version" : "3.4" }, "ok" : 1 }
      admin> use local
      switched to db local
      local> db.runCommand({listCollections: 1})
      {
          "cursor" : {
              "id" : NumberLong(0),
              "ns" : "local.$cmd.listCollections",
              "firstBatch" : [
                  {
                      "name" : "startup_log",
                      "type" : "collection",
                      "options" : {
                          "capped" : true,
                          "size" : 10485760
                      },
                      "info" : {
                          "readOnly" : false,
                          "uuid" : BinData(4,"8Vlh0RQDSSy2HRFJJlBVDQ==")
                      },
                      "idIndex" : {
                          "v" : 2,
                          "key" : {
                              "_id" : 1
                          },
                          "name" : "_id_",
                          "ns" : "local.startup_log"
                      }
                  }
              ]
          },
          "ok" : 1
      }
      local> db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1})
      { "featureCompatibilityVersion" : { "version" : "3.4" }, "ok" : 1 }
      local> db.version()
      

      As shown, info.uuid is still present in the local.startup_log collection.

      Show
      The following shows how dropping the admin db may leave UUIDs. test> db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1}) { "featureCompatibilityVersion" : { "version" : "3.6" }, "ok" : 1 } test> use local switched to db local local> db.runCommand({listCollections: 1}) { "cursor" : { "id" : NumberLong(0), "ns" : "local.$cmd.listCollections", "firstBatch" : [ { "name" : "startup_log", "type" : "collection", "options" : { "capped" : true, "size" : 10485760 }, "info" : { "readOnly" : false, "uuid" : BinData(4,"8Vlh0RQDSSy2HRFJJlBVDQ==") }, "idIndex" : { "v" : 2, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "local.startup_log" } } ] }, "ok" : 1 } local> use admin switched to db admin admin> db.dropDatabase() { "dropped" : "admin", "ok" : 1 } admin> db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1}) { "featureCompatibilityVersion" : { "version" : "3.4" }, "ok" : 1 } admin> use local switched to db local local> db.runCommand({listCollections: 1}) { "cursor" : { "id" : NumberLong(0), "ns" : "local.$cmd.listCollections", "firstBatch" : [ { "name" : "startup_log", "type" : "collection", "options" : { "capped" : true, "size" : 10485760 }, "info" : { "readOnly" : false, "uuid" : BinData(4,"8Vlh0RQDSSy2HRFJJlBVDQ==") }, "idIndex" : { "v" : 2, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "local.startup_log" } } ] }, "ok" : 1 } local> db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1}) { "featureCompatibilityVersion" : { "version" : "3.4" }, "ok" : 1 } local> db.version() As shown, info.uuid is still present in the local.startup_log collection.
    • Storage 2018-01-01, Storage 2018-01-15, Storage 2018-02-12
    • 120

    Description

      Dropping the admin database sets FCV to 3.4 but does not downgrade properly. E.g. UUIDs still remain in the collection catalog.

      This is only possible on a standalone mongod, replset nodes disallow this.

      As discussed, maybe we don't want to allow users to drop admin database.

      Attachments

        Issue Links

          Activity

            People

              maria.vankeulen@mongodb.com Maria van Keulen
              kevin.albertson@mongodb.com Kevin Albertson
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: