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

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.6.0
    • Fix Version/s: 3.6.3, 3.7.2
    • Component/s: Upgrade/Downgrade
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.6
    • Steps To Reproduce:
      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.
    • Sprint:
      Storage 2018-01-01, Storage 2018-01-15, Storage 2018-02-12

      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

              Assignee:
              maria.vankeulen Maria van Keulen
              Reporter:
              kevin.albertson Kevin Albertson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: