summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Marks <gabriel.marks@mongodb.com>2022-09-23 16:51:37 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-23 18:07:13 +0000
commit4a6287c11735c731951b2f6c417b0ad4497a000a (patch)
treeb4d454e74a2da15c250dc8a0901a0788ca8e250c
parentcd39149861aeea410f4b1f3018adcb780aa340b6 (diff)
downloadmongo-4a6287c11735c731951b2f6c417b0ad4497a000a.tar.gz
SERVER-69860 Fix issue where dropping config would crash
-rw-r--r--jstests/noPassthrough/drop_config_db.js18
-rw-r--r--src/mongo/db/server_parameter.h2
2 files changed, 19 insertions, 1 deletions
diff --git a/jstests/noPassthrough/drop_config_db.js b/jstests/noPassthrough/drop_config_db.js
new file mode 100644
index 00000000000..c629d41d7a9
--- /dev/null
+++ b/jstests/noPassthrough/drop_config_db.js
@@ -0,0 +1,18 @@
+/*
+ * Test that dropping the config DB does not crash the server.
+ */
+(function() {
+"use strict";
+
+TestData.enableTestCommands = false;
+
+const mongod = MongoRunner.runMongod();
+const config = mongod.getDB('config');
+
+// Create a collection in config to ensure that it exists before dropping it.
+assert.commandWorked(config.runCommand({create: 'test'}));
+// Dropping the config DB should succeed.
+assert.commandWorked(config.dropDatabase());
+
+MongoRunner.stopMongod(mongod);
+})();
diff --git a/src/mongo/db/server_parameter.h b/src/mongo/db/server_parameter.h
index 31ffd29ee2a..4d583096c33 100644
--- a/src/mongo/db/server_parameter.h
+++ b/src/mongo/db/server_parameter.h
@@ -197,7 +197,7 @@ public:
* retrieving it via this method.
*/
virtual LogicalTime getClusterParameterTime(const boost::optional<TenantId>& tenantId) const {
- MONGO_UNREACHABLE;
+ return LogicalTime::kUninitialized;
}
bool isTestOnly() const {