summaryrefslogtreecommitdiff
path: root/src/mongo/db/repair_database_and_check_version.cpp
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2020-02-10 10:11:25 +0100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-10 13:08:24 +0000
commit43c2b5b172cf6783319944c0d6931478db01eefa (patch)
tree16da88e0a58c73bdfd3f721c8376223925e0e07f /src/mongo/db/repair_database_and_check_version.cpp
parent4ae67479e73174a75f2d7141360edb8a8ef90be8 (diff)
downloadmongo-43c2b5b172cf6783319944c0d6931478db01eefa.tar.gz
SERVER-45805 Add recordPreImages flag to collMod and create commands
create mode 100644 jstests/noPassthrough/record_preimage_startup_validation.js
Diffstat (limited to 'src/mongo/db/repair_database_and_check_version.cpp')
-rw-r--r--src/mongo/db/repair_database_and_check_version.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/repair_database_and_check_version.cpp b/src/mongo/db/repair_database_and_check_version.cpp
index abbccedf1dd..f152e9c378c 100644
--- a/src/mongo/db/repair_database_and_check_version.cpp
+++ b/src/mongo/db/repair_database_and_check_version.cpp
@@ -493,6 +493,13 @@ bool repairDatabasesAndCheckVersion(OperationContext* opCtx) {
// Refresh list of database names to include newly-created admin, if it exists.
dbNames = storageEngine->listDatabases();
+
+ // We want to recover the admin database first so we can load the FCV early since
+ // some collection validation may depend on the FCV being set.
+ if (auto it = std::find(dbNames.begin(), dbNames.end(), "admin"); it != dbNames.end()) {
+ std::swap(*it, dbNames.front());
+ }
+
for (const auto& dbName : dbNames) {
if (dbName != "local") {
nonLocalDatabases = true;