summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 {