summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2020-08-01 10:51:21 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-01 15:03:53 +0000
commitd4e44c7c61512e7e823a4e46e91ab393b7d4b8fc (patch)
tree088fbb765ca23a1153d98d0fa4be52ad10be51b2 /src
parenteee49c64cdeb8fa95704b9a316b779eb5eb9800c (diff)
downloadmongo-d4e44c7c61512e7e823a4e46e91ab393b7d4b8fc.tar.gz
SERVER-49301 remove startingAfterUncleanShutdown decorator
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/SConscript1
-rw-r--r--src/mongo/db/mongod_main.cpp9
-rw-r--r--src/mongo/db/storage/storage_engine_init.cpp2
-rw-r--r--src/mongo/db/unclean_shutdown.cpp44
-rw-r--r--src/mongo/db/unclean_shutdown.h40
5 files changed, 0 insertions, 96 deletions
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript
index decffa6e11c..bf2c2f6bc63 100644
--- a/src/mongo/db/SConscript
+++ b/src/mongo/db/SConscript
@@ -442,7 +442,6 @@ env.Library(
'operation_key_manager.cpp',
'service_context.cpp',
'server_recovery.cpp',
- 'unclean_shutdown.cpp',
'repl_set_member_in_standalone_mode.cpp',
],
LIBDEPS=[
diff --git a/src/mongo/db/mongod_main.cpp b/src/mongo/db/mongod_main.cpp
index 4a13a44fde8..179b8a6138b 100644
--- a/src/mongo/db/mongod_main.cpp
+++ b/src/mongo/db/mongod_main.cpp
@@ -155,7 +155,6 @@
#include "mongo/db/system_index.h"
#include "mongo/db/transaction_participant.h"
#include "mongo/db/ttl.h"
-#include "mongo/db/unclean_shutdown.h"
#include "mongo/db/wire_version.h"
#include "mongo/executor/network_connection_hook.h"
#include "mongo/executor/network_interface_factory.h"
@@ -461,14 +460,6 @@ ExitCode _initAndListen(ServiceContext* serviceContext, int listenPort) {
// error.
FeatureCompatibilityVersion::fassertInitializedAfterStartup(startupOpCtx.get());
- // This flag is used during storage engine initialization to perform behavior that is specific
- // to recovering from an unclean shutdown. It is also used to determine whether temporary files
- // should be removed. The last of these uses is done by repairDatabasesAndCheckVersion() above,
- // so we reset the flag to false here. We reset the flag so that other users of these functions
- // outside of startup do not perform behavior that is specific to starting up after an unclean
- // shutdown.
- startingAfterUncleanShutdown(serviceContext) = false;
-
if (gFlowControlEnabled.load()) {
LOGV2(20536, "Flow Control is enabled on this deployment");
}
diff --git a/src/mongo/db/storage/storage_engine_init.cpp b/src/mongo/db/storage/storage_engine_init.cpp
index 05157f70094..85c1c75cb89 100644
--- a/src/mongo/db/storage/storage_engine_init.cpp
+++ b/src/mongo/db/storage/storage_engine_init.cpp
@@ -45,7 +45,6 @@
#include "mongo/db/storage/storage_engine_metadata.h"
#include "mongo/db/storage/storage_options.h"
#include "mongo/db/storage/storage_repair_observer.h"
-#include "mongo/db/unclean_shutdown.h"
#include "mongo/logv2/log.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/str.h"
@@ -223,7 +222,6 @@ void createLockFile(ServiceContext* service) {
LOGV2_WARNING(22271,
"Detected unclean shutdown - Lock file is not empty",
"lockFile"_attr = lockFile->getFilespec());
- startingAfterUncleanShutdown(service) = true;
}
}
diff --git a/src/mongo/db/unclean_shutdown.cpp b/src/mongo/db/unclean_shutdown.cpp
deleted file mode 100644
index 39975079205..00000000000
--- a/src/mongo/db/unclean_shutdown.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (C) 2018-present MongoDB, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the Server Side Public License, version 1,
- * as published by MongoDB, Inc.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * Server Side Public License for more details.
- *
- * You should have received a copy of the Server Side Public License
- * along with this program. If not, see
- * <http://www.mongodb.com/licensing/server-side-public-license>.
- *
- * As a special exception, the copyright holders give permission to link the
- * code of portions of this program with the OpenSSL library under certain
- * conditions as described in each individual source file and distribute
- * linked combinations including the program with the OpenSSL library. You
- * must comply with the Server Side Public License in all respects for
- * all of the code used other than as permitted herein. If you modify file(s)
- * with this exception, you may extend this exception to your version of the
- * file(s), but you are not obligated to do so. If you do not wish to do so,
- * delete this exception statement from your version. If you delete this
- * exception statement from all source files in the program, then also delete
- * it in the license file.
- */
-
-#include "mongo/platform/basic.h"
-
-#include "mongo/db/unclean_shutdown.h"
-
-namespace mongo {
-namespace {
-// The bool decoration will be initialized to false, as primitive decorations undergo value
-// initialization.
-const auto startingUnclean = ServiceContext::declareDecoration<bool>();
-} // namespace
-} // namespace mongo
-
-bool& mongo::startingAfterUncleanShutdown(ServiceContext* serviceCtx) {
- return startingUnclean(serviceCtx);
-}
diff --git a/src/mongo/db/unclean_shutdown.h b/src/mongo/db/unclean_shutdown.h
deleted file mode 100644
index e243efc61f6..00000000000
--- a/src/mongo/db/unclean_shutdown.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Copyright (C) 2018-present MongoDB, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the Server Side Public License, version 1,
- * as published by MongoDB, Inc.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * Server Side Public License for more details.
- *
- * You should have received a copy of the Server Side Public License
- * along with this program. If not, see
- * <http://www.mongodb.com/licensing/server-side-public-license>.
- *
- * As a special exception, the copyright holders give permission to link the
- * code of portions of this program with the OpenSSL library under certain
- * conditions as described in each individual source file and distribute
- * linked combinations including the program with the OpenSSL library. You
- * must comply with the Server Side Public License in all respects for
- * all of the code used other than as permitted herein. If you modify file(s)
- * with this exception, you may extend this exception to your version of the
- * file(s), but you are not obligated to do so. If you do not wish to do so,
- * delete this exception statement from your version. If you delete this
- * exception statement from all source files in the program, then also delete
- * it in the license file.
- */
-
-#pragma once
-
-#include "mongo/db/service_context.h"
-
-namespace mongo {
-/**
- * Gets a mutable reference to a boolean decoration on 'serviceCtx', which indicates whether or not
- * this server is starting after an unclean shutdown.
- */
-bool& startingAfterUncleanShutdown(ServiceContext* serviceCtx);
-} // namespace mongo