[SERVER-32205] Dropping admin db sets FCV to 3.4 but leaves UUIDs Created: 07/Dec/17  Updated: 30/Oct/23  Resolved: 11/Feb/18

Status: Closed
Project: Core Server
Component/s: Upgrade/Downgrade
Affects Version/s: 3.6.0
Fix Version/s: 3.6.3, 3.7.2

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Maria van Keulen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-33014 Ensure theoretically unreachable feat... Closed
Related
related to SERVER-29448 Disallow dropping "admin" and "local"... Closed
is related to SERVER-32126 validate() should do basic sanity che... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6
Steps To Reproduce:

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
Participants:
Linked BF Score: 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.



 Comments   
Comment by Githook User [ 13/Feb/18 ]

Author:

{'email': 'maria@mongodb.com', 'name': 'Maria van Keulen', 'username': 'mvankeulen94'}

Message: SERVER-32205 Prohibit dropping the admin database at catalog level

(cherry picked from commit 72fc7cea722f952e3ad47c5470cb60ae2114097f)
Branch: v3.6
https://github.com/mongodb/mongo/commit/200871c6f995ff1e51ca6565deecb01778b15d47

Comment by Githook User [ 09/Feb/18 ]

Author:

{'email': 'maria@mongodb.com', 'name': 'Maria van Keulen', 'username': 'mvankeulen94'}

Message: SERVER-32205 Prohibit dropping the admin database at catalog level
Branch: master
https://github.com/mongodb/mongo/commit/72fc7cea722f952e3ad47c5470cb60ae2114097f

Comment by Githook User [ 08/Dec/17 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs'}

Message: SERVER-32205 do not drop admin db
Branch: master
https://github.com/10gen/jstestfuzz/commit/3d2768ae609a171dc2bb56f6c113dd45ab36a779

Comment by Kevin Albertson [ 07/Dec/17 ]

milkie Correct, I updated the description.

Comment by Kaloian Manassiev [ 07/Dec/17 ]

Just FYI - I believe we are getting rid of standalone nodes in one of the 3.6 follow-up releases.

Comment by Eric Milkie [ 07/Dec/17 ]

This is on a standalone node only, correct? I don't think you can drop the admin db on a replset node.

Generated at Thu Feb 08 04:29:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.