summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorauto-revert-processor <dev-prod-dag@mongodb.com>2023-05-18 01:59:49 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-05-18 02:54:21 +0000
commita741f91c4c09913424751730aabccd594e94ab78 (patch)
tree93a23e52e3a8d077bea2f722912a88a6e270a8dc
parentd7bf13d97da047abfe9098a6b5f98678e89cd987 (diff)
downloadmongo-a741f91c4c09913424751730aabccd594e94ab78.tar.gz
Revert "SERVER-77224 Rename lock_state.h/.cpp to locker_impl.h/.cpp to match the class name"HEADmaster
This reverts commit de55cd2ac227dcc8cae2fd021abc291e86b2abb2.
-rw-r--r--buildscripts/gdb/mongo.py2
-rw-r--r--buildscripts/gdb/mongo_lock.py2
-rw-r--r--src/mongo/crypto/SConscript1
-rw-r--r--src/mongo/db/SConscript2
-rw-r--r--src/mongo/db/auth/SConscript1
-rw-r--r--src/mongo/db/catalog/capped_collection_test.cpp4
-rw-r--r--src/mongo/db/catalog/collection_catalog_bm.cpp2
-rw-r--r--src/mongo/db/catalog/rename_collection.cpp4
-rw-r--r--src/mongo/db/catalog_raii_test.cpp2
-rw-r--r--src/mongo/db/commands/SConscript1
-rw-r--r--src/mongo/db/commands/current_op.cpp3
-rw-r--r--src/mongo/db/commands/lock_info.cpp6
-rw-r--r--src/mongo/db/concurrency/SConscript25
-rw-r--r--src/mongo/db/concurrency/d_concurrency.cpp23
-rw-r--r--src/mongo/db/concurrency/d_concurrency.h21
-rw-r--r--src/mongo/db/concurrency/lock_manager.h2
-rw-r--r--src/mongo/db/concurrency/lock_manager_defs.cpp2
-rw-r--r--src/mongo/db/concurrency/lock_manager_test_help.h2
-rw-r--r--src/mongo/db/concurrency/lock_state.cpp (renamed from src/mongo/db/concurrency/locker_impl.cpp)18
-rw-r--r--src/mongo/db/concurrency/lock_state.h (renamed from src/mongo/db/concurrency/locker_impl.h)10
-rw-r--r--src/mongo/db/concurrency/lock_state_test.cpp (renamed from src/mongo/db/concurrency/locker_impl_test.cpp)0
-rw-r--r--src/mongo/db/concurrency/locker.cpp38
-rw-r--r--src/mongo/db/concurrency/locker.h4
-rw-r--r--src/mongo/db/curop.h2
-rw-r--r--src/mongo/db/db_raii_multi_collection_test.cpp2
-rw-r--r--src/mongo/db/db_raii_test.cpp2
-rw-r--r--src/mongo/db/exec/sbe/abt/sbe_abt_diff_test.cpp2
-rw-r--r--src/mongo/db/index/SConscript2
-rw-r--r--src/mongo/db/introspect.cpp2
-rw-r--r--src/mongo/db/mongod_main.cpp2
-rw-r--r--src/mongo/db/operation_context.h6
-rw-r--r--src/mongo/db/pipeline/process_interface/shardsvr_process_interface_test.cpp2
-rw-r--r--src/mongo/db/process_health/SConscript1
-rw-r--r--src/mongo/db/query/SConscript14
-rw-r--r--src/mongo/db/query/ce/maxdiff_histogram_test.cpp2
-rw-r--r--src/mongo/db/query/optimizer/SConscript1
-rw-r--r--src/mongo/db/repl/apply_ops.cpp1
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp5
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl_test.cpp6
-rw-r--r--src/mongo/db/service_entry_point_mongod.cpp6
-rw-r--r--src/mongo/db/shard_role.cpp5
-rw-r--r--src/mongo/db/shard_role.h6
-rw-r--r--src/mongo/db/storage/SConscript2
-rw-r--r--src/mongo/db/storage/kv/kv_drop_pending_ident_reaper_test.cpp5
-rw-r--r--src/mongo/db/storage/storage_engine_init.cpp8
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp9
-rw-r--r--src/mongo/db/transaction/transaction_participant.cpp3
-rw-r--r--src/mongo/db/transaction/transaction_participant_test.cpp1
-rw-r--r--src/mongo/embedded/embedded.cpp5
-rw-r--r--src/mongo/executor/SConscript1
-rw-r--r--src/mongo/s/SConscript1
-rw-r--r--src/mongo/shell/SConscript1
-rw-r--r--src/mongo/tools/mongobridge_tool/SConscript13
-rw-r--r--src/mongo/transport/SConscript2
-rw-r--r--src/mongo/unittest/SConscript3
-rw-r--r--src/mongo/util/concurrency/SConscript14
-rw-r--r--src/mongo/util/concurrency/priority_ticketholder.cpp5
-rw-r--r--src/mongo/util/concurrency/priority_ticketholder_test.cpp1
-rw-r--r--src/mongo/util/concurrency/semaphore_ticketholder.cpp7
-rw-r--r--src/mongo/util/concurrency/ticketholder.cpp7
60 files changed, 182 insertions, 150 deletions
diff --git a/buildscripts/gdb/mongo.py b/buildscripts/gdb/mongo.py
index 8f20f1caa85..c7ea555513e 100644
--- a/buildscripts/gdb/mongo.py
+++ b/buildscripts/gdb/mongo.py
@@ -584,6 +584,8 @@ class MongoDBDumpLocks(gdb.Command):
try:
# Call into mongod, and dump the state of lock manager
# Note that output will go to mongod's standard output, not the debugger output window
+ # Do not call mongo::getGlobalLockManager() due to the compiler optimizing this function in a very weird way
+ # See SERVER-72816 for more context
gdb.execute(
"call mongo::LockManager::get((mongo::ServiceContext*) mongo::getGlobalServiceContext())->dump()",
from_tty=False, to_string=False)
diff --git a/buildscripts/gdb/mongo_lock.py b/buildscripts/gdb/mongo_lock.py
index a7f7e271926..d05acaf6779 100644
--- a/buildscripts/gdb/mongo_lock.py
+++ b/buildscripts/gdb/mongo_lock.py
@@ -325,6 +325,8 @@ def find_lock_manager_holders(graph, thread_dict, show):
locker_ptr_type = gdb.lookup_type("mongo::LockerImpl").pointer()
+ # Do not call mongo::getGlobalLockManager() due to the compiler optimizing this function in a very weird way
+ # See SERVER-72816 for more context
lock_head = gdb.parse_and_eval(
"mongo::LockManager::get((mongo::ServiceContext*) mongo::getGlobalServiceContext())->_getBucket(resId)->findOrInsert(resId)"
)
diff --git a/src/mongo/crypto/SConscript b/src/mongo/crypto/SConscript
index 3271c7b0b73..67aadbffd76 100644
--- a/src/mongo/crypto/SConscript
+++ b/src/mongo/crypto/SConscript
@@ -156,7 +156,6 @@ env.CppUnitTest(
LIBDEPS=[
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/base/secure_allocator',
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/shell/kms_idl',
'$BUILD_DIR/mongo/util/net/http_client_impl',
'$BUILD_DIR/mongo/util/net/openssl_init' if ssl_provider == 'openssl' else [],
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript
index eaafde9af99..d0e8b323673 100644
--- a/src/mongo/db/SConscript
+++ b/src/mongo/db/SConscript
@@ -767,7 +767,7 @@ env.Library(
)
env.Library(
- target='metadata_consistency_types_idl',
+ target="metadata_consistency_types_idl",
source=[
'metadata_consistency_types.idl',
],
diff --git a/src/mongo/db/auth/SConscript b/src/mongo/db/auth/SConscript
index ee465b1e438..59b102026fd 100644
--- a/src/mongo/db/auth/SConscript
+++ b/src/mongo/db/auth/SConscript
@@ -489,7 +489,6 @@ env.Library(
'authz_session_external_state_mock.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/query_expressions',
'$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/db/update/update_driver',
diff --git a/src/mongo/db/catalog/capped_collection_test.cpp b/src/mongo/db/catalog/capped_collection_test.cpp
index 3d23339c768..b95317f207d 100644
--- a/src/mongo/db/catalog/capped_collection_test.cpp
+++ b/src/mongo/db/catalog/capped_collection_test.cpp
@@ -27,11 +27,13 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/catalog/capped_visibility.h"
#include "mongo/db/catalog/catalog_test_fixture.h"
#include "mongo/db/catalog/collection.h"
#include "mongo/db/catalog/collection_write_path.h"
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/record_id_helpers.h"
#include "mongo/db/repl/replication_coordinator_mock.h"
diff --git a/src/mongo/db/catalog/collection_catalog_bm.cpp b/src/mongo/db/catalog/collection_catalog_bm.cpp
index 0fd4bf9d9bc..57898636095 100644
--- a/src/mongo/db/catalog/collection_catalog_bm.cpp
+++ b/src/mongo/db/catalog/collection_catalog_bm.cpp
@@ -32,7 +32,7 @@
#include "mongo/db/catalog/collection_catalog.h"
#include "mongo/db/catalog/collection_mock.h"
#include "mongo/db/concurrency/d_concurrency.h"
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/service_context.h"
#include "mongo/util/uuid.h"
diff --git a/src/mongo/db/catalog/rename_collection.cpp b/src/mongo/db/catalog/rename_collection.cpp
index 8c171c2532f..c0f0f633423 100644
--- a/src/mongo/db/catalog/rename_collection.cpp
+++ b/src/mongo/db/catalog/rename_collection.cpp
@@ -42,6 +42,7 @@
#include "mongo/db/catalog/unique_collection_name.h"
#include "mongo/db/client.h"
#include "mongo/db/concurrency/exception_util.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/curop.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/index/index_descriptor.h"
@@ -53,9 +54,10 @@
#include "mongo/db/ops/insert.h"
#include "mongo/db/query/query_knobs_gen.h"
#include "mongo/db/repl/replication_coordinator.h"
+#include "mongo/db/s/database_sharding_state.h"
+#include "mongo/db/s/operation_sharding_state.h"
#include "mongo/db/server_options.h"
#include "mongo/db/service_context.h"
-#include "mongo/db/shard_role.h"
#include "mongo/db/storage/storage_parameters_gen.h"
#include "mongo/logv2/log.h"
#include "mongo/util/fail_point.h"
diff --git a/src/mongo/db/catalog_raii_test.cpp b/src/mongo/db/catalog_raii_test.cpp
index 158b8111163..f035cc6bd2e 100644
--- a/src/mongo/db/catalog_raii_test.cpp
+++ b/src/mongo/db/catalog_raii_test.cpp
@@ -30,7 +30,7 @@
#include "mongo/db/catalog/database_holder_mock.h"
#include "mongo/db/catalog_raii.h"
#include "mongo/db/client.h"
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/service_context_test_fixture.h"
#include "mongo/db/storage/recovery_unit_noop.h"
#include "mongo/logv2/log.h"
diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript
index 26ed44f60af..a1b52019334 100644
--- a/src/mongo/db/commands/SConscript
+++ b/src/mongo/db/commands/SConscript
@@ -199,7 +199,6 @@ env.Library(
'$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/query/op_metrics',
'$BUILD_DIR/mongo/db/storage/backup_cursor_hooks',
- '$BUILD_DIR/mongo/util/background_job',
'fsync_locked',
],
)
diff --git a/src/mongo/db/commands/current_op.cpp b/src/mongo/db/commands/current_op.cpp
index 913265cba27..dd888b36db8 100644
--- a/src/mongo/db/commands/current_op.cpp
+++ b/src/mongo/db/commands/current_op.cpp
@@ -27,6 +27,8 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/commands/current_op_common.h"
#include "mongo/db/auth/action_type.h"
@@ -37,6 +39,7 @@
#include "mongo/db/exec/document_value/document.h"
#include "mongo/db/pipeline/aggregate_command_gen.h"
#include "mongo/db/pipeline/aggregation_request_helper.h"
+#include "mongo/db/stats/fill_locker_info.h"
namespace mongo {
diff --git a/src/mongo/db/commands/lock_info.cpp b/src/mongo/db/commands/lock_info.cpp
index 2f75ed1be36..d7e77df6453 100644
--- a/src/mongo/db/commands/lock_info.cpp
+++ b/src/mongo/db/commands/lock_info.cpp
@@ -27,10 +27,16 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
+#include <map>
+
#include "mongo/db/auth/action_type.h"
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/client.h"
#include "mongo/db/commands.h"
+#include "mongo/db/concurrency/lock_manager_defs.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/service_context.h"
diff --git a/src/mongo/db/concurrency/SConscript b/src/mongo/db/concurrency/SConscript
index 872b28b8047..efd2d335cf2 100644
--- a/src/mongo/db/concurrency/SConscript
+++ b/src/mongo/db/concurrency/SConscript
@@ -37,29 +37,39 @@ env.Library(
)
env.Library(
+ target='lock_manager_defs',
+ source=[
+ 'lock_manager_defs.cpp',
+ ],
+ LIBDEPS=[
+ '$BUILD_DIR/mongo/base',
+ '$BUILD_DIR/mongo/util/namespace_string_database_name_util',
+ ],
+)
+
+env.Library(
target='lock_manager',
source=[
'd_concurrency.cpp',
'lock_manager.cpp',
- 'lock_manager_defs.cpp',
+ 'lock_state.cpp',
'lock_stats.cpp',
- 'locker.cpp',
- 'locker_impl.cpp',
'replication_state_transition_lock_guard.cpp',
'resource_catalog.cpp',
],
LIBDEPS=[
+ '$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/db/storage/concurrency_adjustment_parameters',
'$BUILD_DIR/mongo/db/storage/storage_engine_parameters',
+ '$BUILD_DIR/mongo/util/background_job',
'$BUILD_DIR/mongo/util/concurrency/spin_lock',
'$BUILD_DIR/mongo/util/concurrency/ticketholder',
+ '$BUILD_DIR/third_party/shim_boost',
+ 'lock_manager_defs',
],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/concurrency/flow_control_ticketholder',
'$BUILD_DIR/mongo/db/server_base',
- '$BUILD_DIR/mongo/db/service_context',
- '$BUILD_DIR/mongo/util/background_job',
- '$BUILD_DIR/mongo/util/namespace_string_database_name_util',
],
)
@@ -79,7 +89,6 @@ env.Benchmark(
'd_concurrency_bm.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/service_context',
'lock_manager',
],
)
@@ -90,8 +99,8 @@ env.CppUnitTest(
'd_concurrency_test.cpp',
'fast_map_noalloc_test.cpp',
'lock_manager_test.cpp',
+ 'lock_state_test.cpp',
'lock_stats_test.cpp',
- 'locker_impl_test.cpp',
'resource_catalog_test.cpp',
],
LIBDEPS=[
diff --git a/src/mongo/db/concurrency/d_concurrency.cpp b/src/mongo/db/concurrency/d_concurrency.cpp
index 9fe447c15f0..fe7daed7201 100644
--- a/src/mongo/db/concurrency/d_concurrency.cpp
+++ b/src/mongo/db/concurrency/d_concurrency.cpp
@@ -29,9 +29,11 @@
#include "mongo/db/concurrency/d_concurrency.h"
+#include <memory>
#include <string>
#include <vector>
+#include "mongo/db/concurrency/flow_control_ticketholder.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/service_context.h"
#include "mongo/logv2/log.h"
@@ -176,27 +178,6 @@ Lock::GlobalLock::GlobalLock(GlobalLock&& otherLock)
otherLock._result = LOCK_INVALID;
}
-Lock::GlobalLock::~GlobalLock() {
- // Preserve the original lock result which will be overridden by unlock().
- auto lockResult = _result;
- auto* locker = _opCtx->lockState();
-
- if (isLocked()) {
- // Abandon our snapshot if destruction of the GlobalLock object results in actually
- // unlocking the global lock. Recursive locking and the two-phase locking protocol may
- // prevent lock release.
- const bool willReleaseLock = _isOutermostLock && !locker->inAWriteUnitOfWork();
- if (willReleaseLock) {
- _opCtx->recoveryUnit()->abandonSnapshot();
- }
- _unlock();
- }
-
- if (!_skipRSTLLock && (lockResult == LOCK_OK || lockResult == LOCK_WAITING)) {
- locker->unlock(resourceIdReplicationStateTransitionLock);
- }
-}
-
void Lock::GlobalLock::_unlock() {
_opCtx->lockState()->unlockGlobal();
_result = LOCK_INVALID;
diff --git a/src/mongo/db/concurrency/d_concurrency.h b/src/mongo/db/concurrency/d_concurrency.h
index 9cf4aef7c7e..aacd3b6d724 100644
--- a/src/mongo/db/concurrency/d_concurrency.h
+++ b/src/mongo/db/concurrency/d_concurrency.h
@@ -29,6 +29,8 @@
#pragma once
+#include <climits> // For UINT_MAX
+
#include "mongo/db/concurrency/locker.h"
#include "mongo/db/operation_context.h"
#include "mongo/util/timer.h"
@@ -244,7 +246,24 @@ public:
GlobalLock(GlobalLock&&);
- ~GlobalLock();
+ ~GlobalLock() {
+ // Preserve the original lock result which will be overridden by unlock().
+ auto lockResult = _result;
+ if (isLocked()) {
+ // Abandon our snapshot if destruction of the GlobalLock object results in actually
+ // unlocking the global lock. Recursive locking and the two-phase locking protocol
+ // may prevent lock release.
+ const bool willReleaseLock = _isOutermostLock &&
+ !(_opCtx->lockState() && _opCtx->lockState()->inAWriteUnitOfWork());
+ if (willReleaseLock) {
+ _opCtx->recoveryUnit()->abandonSnapshot();
+ }
+ _unlock();
+ }
+ if (!_skipRSTLLock && (lockResult == LOCK_OK || lockResult == LOCK_WAITING)) {
+ _opCtx->lockState()->unlock(resourceIdReplicationStateTransitionLock);
+ }
+ }
bool isLocked() const {
return _result == LOCK_OK;
diff --git a/src/mongo/db/concurrency/lock_manager.h b/src/mongo/db/concurrency/lock_manager.h
index 18a20900332..4b82349432c 100644
--- a/src/mongo/db/concurrency/lock_manager.h
+++ b/src/mongo/db/concurrency/lock_manager.h
@@ -63,6 +63,8 @@ public:
* Retrieves the lock manager instance attached to this ServiceContext.
* The lock manager is now a decoration on the service context and this is the accessor that
* most callers should prefer outside of startup, lock internals, and debugger scripts.
+ * Using the ServiceContext and OperationContext versions where possible is preferable to
+ * getGlobalLockManager().
*/
static LockManager* get(ServiceContext* service);
static LockManager* get(ServiceContext& service);
diff --git a/src/mongo/db/concurrency/lock_manager_defs.cpp b/src/mongo/db/concurrency/lock_manager_defs.cpp
index 655340a355d..38f3976c0ea 100644
--- a/src/mongo/db/concurrency/lock_manager_defs.cpp
+++ b/src/mongo/db/concurrency/lock_manager_defs.cpp
@@ -27,7 +27,7 @@
* it in the license file.
*/
-#include "mongo/db/concurrency/lock_manager_defs.h"
+#include "lock_manager_defs.h"
namespace mongo {
diff --git a/src/mongo/db/concurrency/lock_manager_test_help.h b/src/mongo/db/concurrency/lock_manager_test_help.h
index c7b9212dc03..5eba9d33dbd 100644
--- a/src/mongo/db/concurrency/lock_manager_test_help.h
+++ b/src/mongo/db/concurrency/lock_manager_test_help.h
@@ -30,7 +30,7 @@
#pragma once
#include "mongo/db/concurrency/lock_manager.h"
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
namespace mongo {
diff --git a/src/mongo/db/concurrency/locker_impl.cpp b/src/mongo/db/concurrency/lock_state.cpp
index a45cb05679d..e53a2e955b7 100644
--- a/src/mongo/db/concurrency/locker_impl.cpp
+++ b/src/mongo/db/concurrency/lock_state.cpp
@@ -27,12 +27,16 @@
* it in the license file.
*/
-#include "mongo/db/concurrency/locker_impl.h"
+
+#include "mongo/platform/basic.h"
+
+#include "mongo/db/concurrency/lock_state.h"
#include <vector>
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/bson/json.h"
+#include "mongo/db/concurrency/flow_control_ticketholder.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/service_context.h"
#include "mongo/db/storage/flow_control.h"
@@ -137,12 +141,6 @@ PartitionedInstanceWideLockStats globalStats;
} // namespace
-LockManager* getGlobalLockManager() {
- auto serviceContext = getGlobalServiceContext();
- invariant(serviceContext);
- return LockManager::get(serviceContext);
-}
-
bool LockerImpl::_shouldDelayUnlock(ResourceId resId, LockMode mode) const {
switch (resId.getType()) {
case RESOURCE_MUTEX:
@@ -1230,6 +1228,12 @@ public:
// Standalone functions
//
+LockManager* getGlobalLockManager() {
+ auto serviceContext = getGlobalServiceContext();
+ invariant(serviceContext);
+ return LockManager::get(serviceContext);
+}
+
void reportGlobalLockingStats(SingleThreadedLockStats* outStats) {
globalStats.report(outStats);
}
diff --git a/src/mongo/db/concurrency/locker_impl.h b/src/mongo/db/concurrency/lock_state.h
index 2f83580de83..0d19a10cac8 100644
--- a/src/mongo/db/concurrency/locker_impl.h
+++ b/src/mongo/db/concurrency/lock_state.h
@@ -436,4 +436,14 @@ public:
}
};
+/**
+ * Retrieves the global lock manager instance.
+ * Legacy global lock manager accessor for internal lock implementation * and debugger scripts
+ * such as gdb/mongo_lock.py.
+ * The lock manager is now a decoration on the service context and this accessor is retained for
+ * startup, lock internals, and debugger scripts.
+ * Using LockManager::get(ServiceContext*) where possible is preferable.
+ */
+LockManager* getGlobalLockManager();
+
} // namespace mongo
diff --git a/src/mongo/db/concurrency/locker_impl_test.cpp b/src/mongo/db/concurrency/lock_state_test.cpp
index 6e67f7c31ea..6e67f7c31ea 100644
--- a/src/mongo/db/concurrency/locker_impl_test.cpp
+++ b/src/mongo/db/concurrency/lock_state_test.cpp
diff --git a/src/mongo/db/concurrency/locker.cpp b/src/mongo/db/concurrency/locker.cpp
deleted file mode 100644
index 296ed9f9e63..00000000000
--- a/src/mongo/db/concurrency/locker.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (C) 2023-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/db/concurrency/locker.h"
-
-namespace mongo {
-
-Locker::Locker() = default;
-
-Locker::~Locker() = default;
-
-} // namespace mongo
diff --git a/src/mongo/db/concurrency/locker.h b/src/mongo/db/concurrency/locker.h
index 26f12adbd0b..59a4c92d9c5 100644
--- a/src/mongo/db/concurrency/locker.h
+++ b/src/mongo/db/concurrency/locker.h
@@ -57,7 +57,7 @@ class Locker {
public:
using LockTimeoutCallback = std::function<void()>;
- virtual ~Locker();
+ virtual ~Locker() {}
/**
* Returns true if this is an instance of LockerNoop. Because LockerNoop doesn't implement many
@@ -570,7 +570,7 @@ public:
}
protected:
- Locker();
+ Locker() {}
/**
* The number of callers that are guarding from lock interruptions.
diff --git a/src/mongo/db/curop.h b/src/mongo/db/curop.h
index c19586d5833..9f5c32b10d1 100644
--- a/src/mongo/db/curop.h
+++ b/src/mongo/db/curop.h
@@ -30,6 +30,8 @@
#pragma once
+#include <memory>
+
#include "mongo/config.h"
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/auth/user_acquisition_stats.h"
diff --git a/src/mongo/db/db_raii_multi_collection_test.cpp b/src/mongo/db/db_raii_multi_collection_test.cpp
index 439697d2128..da00f5b9fa5 100644
--- a/src/mongo/db/db_raii_multi_collection_test.cpp
+++ b/src/mongo/db/db_raii_multi_collection_test.cpp
@@ -29,7 +29,7 @@
#include "mongo/db/catalog/catalog_test_fixture.h"
#include "mongo/db/client.h"
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/db_raii.h"
#include "mongo/logv2/log.h"
#include "mongo/unittest/unittest.h"
diff --git a/src/mongo/db/db_raii_test.cpp b/src/mongo/db/db_raii_test.cpp
index 64f421c988e..d2eba6919cc 100644
--- a/src/mongo/db/db_raii_test.cpp
+++ b/src/mongo/db/db_raii_test.cpp
@@ -31,7 +31,7 @@
#include "mongo/db/catalog/catalog_test_fixture.h"
#include "mongo/db/client.h"
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/query/find_common.h"
#include "mongo/db/query/get_executor.h"
diff --git a/src/mongo/db/exec/sbe/abt/sbe_abt_diff_test.cpp b/src/mongo/db/exec/sbe/abt/sbe_abt_diff_test.cpp
index 7557690d993..d71b3d040d6 100644
--- a/src/mongo/db/exec/sbe/abt/sbe_abt_diff_test.cpp
+++ b/src/mongo/db/exec/sbe/abt/sbe_abt_diff_test.cpp
@@ -27,7 +27,7 @@
* it in the license file.
*/
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/exec/sbe/abt/sbe_abt_test_util.h"
#include "mongo/unittest/temp_dir.h"
diff --git a/src/mongo/db/index/SConscript b/src/mongo/db/index/SConscript
index c26571bde0f..6a386ae1ada 100644
--- a/src/mongo/db/index/SConscript
+++ b/src/mongo/db/index/SConscript
@@ -70,11 +70,13 @@ iamEnv.Library(
'$BUILD_DIR/mongo/db/multi_key_path_tracker',
'$BUILD_DIR/mongo/db/pipeline/document_path_support',
'$BUILD_DIR/mongo/db/query/collation/collator_factory_interface',
+ '$BUILD_DIR/mongo/db/query/collation/collator_interface',
'$BUILD_DIR/mongo/db/query/op_metrics',
'$BUILD_DIR/mongo/db/query/projection_ast',
'$BUILD_DIR/mongo/db/query/sort_pattern',
'$BUILD_DIR/mongo/db/query_expressions',
'$BUILD_DIR/mongo/db/record_id_helpers',
+ '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
'$BUILD_DIR/mongo/db/resumable_index_builds_idl',
'$BUILD_DIR/mongo/db/server_base',
'$BUILD_DIR/mongo/db/service_context',
diff --git a/src/mongo/db/introspect.cpp b/src/mongo/db/introspect.cpp
index e757543277e..aa52b86af04 100644
--- a/src/mongo/db/introspect.cpp
+++ b/src/mongo/db/introspect.cpp
@@ -35,7 +35,7 @@
#include "mongo/db/catalog/collection_write_path.h"
#include "mongo/db/client.h"
#include "mongo/db/concurrency/exception_util.h"
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/curop.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/jsobj.h"
diff --git a/src/mongo/db/mongod_main.cpp b/src/mongo/db/mongod_main.cpp
index 4fdd1c6f456..8a8e057a8b4 100644
--- a/src/mongo/db/mongod_main.cpp
+++ b/src/mongo/db/mongod_main.cpp
@@ -72,7 +72,7 @@
#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/concurrency/d_concurrency.h"
#include "mongo/db/concurrency/flow_control_ticketholder.h"
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/concurrency/replication_state_transition_lock_guard.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/dbdirectclient.h"
diff --git a/src/mongo/db/operation_context.h b/src/mongo/db/operation_context.h
index 32898918484..0027cb683b1 100644
--- a/src/mongo/db/operation_context.h
+++ b/src/mongo/db/operation_context.h
@@ -29,7 +29,10 @@
#pragma once
+#include "mongo/util/assert_util.h"
#include <boost/optional.hpp>
+#include <cstddef>
+#include <memory>
#include "mongo/base/status.h"
#include "mongo/db/client.h"
@@ -46,7 +49,6 @@
#include "mongo/platform/mutex.h"
#include "mongo/stdx/condition_variable.h"
#include "mongo/transport/session.h"
-#include "mongo/util/assert_util.h"
#include "mongo/util/cancellation.h"
#include "mongo/util/concurrency/with_lock.h"
#include "mongo/util/decorable.h"
@@ -59,7 +61,9 @@
namespace mongo {
class CurOp;
+class ProgressMeter;
class ServiceContext;
+class StringData;
namespace repl {
class UnreplicatedWritesBlock;
diff --git a/src/mongo/db/pipeline/process_interface/shardsvr_process_interface_test.cpp b/src/mongo/db/pipeline/process_interface/shardsvr_process_interface_test.cpp
index 417739a8c34..3a457d8112d 100644
--- a/src/mongo/db/pipeline/process_interface/shardsvr_process_interface_test.cpp
+++ b/src/mongo/db/pipeline/process_interface/shardsvr_process_interface_test.cpp
@@ -27,7 +27,7 @@
* it in the license file.
*/
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/pipeline/document_source_out.h"
#include "mongo/db/pipeline/document_source_queue.h"
#include "mongo/db/pipeline/process_interface/shardsvr_process_interface.h"
diff --git a/src/mongo/db/process_health/SConscript b/src/mongo/db/process_health/SConscript
index 036c0a49fcb..d30b66e619b 100644
--- a/src/mongo/db/process_health/SConscript
+++ b/src/mongo/db/process_health/SConscript
@@ -65,7 +65,6 @@ env.CppUnitTest(
],
LIBDEPS=[
'$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/executor/network_interface_mock',
'$BUILD_DIR/mongo/executor/task_executor_test_fixture',
'$BUILD_DIR/mongo/executor/thread_pool_task_executor_test_fixture',
diff --git a/src/mongo/db/query/SConscript b/src/mongo/db/query/SConscript
index d552d581044..7f9e1c69a00 100644
--- a/src/mongo/db/query/SConscript
+++ b/src/mongo/db/query/SConscript
@@ -275,18 +275,16 @@ env.Library(
)
env.Library(
- target='query_test_service_context',
+ target="query_test_service_context",
source=[
- 'query_test_service_context.cpp',
+ "query_test_service_context.cpp",
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/service_context',
- '$BUILD_DIR/mongo/db/session/logical_session_id',
- 'collation/collator_factory_mock',
- ],
- LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
+ "$BUILD_DIR/mongo/db/service_context",
+ "$BUILD_DIR/mongo/db/session/logical_session_id",
+ "collation/collator_factory_mock",
],
+ LIBDEPS_PRIVATE=[],
)
env.Library(
diff --git a/src/mongo/db/query/ce/maxdiff_histogram_test.cpp b/src/mongo/db/query/ce/maxdiff_histogram_test.cpp
index 10e528cd6e4..7225c1a8774 100644
--- a/src/mongo/db/query/ce/maxdiff_histogram_test.cpp
+++ b/src/mongo/db/query/ce/maxdiff_histogram_test.cpp
@@ -27,7 +27,7 @@
* it in the license file.
*/
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/exec/sbe/abt/sbe_abt_test_util.h"
#include "mongo/db/exec/sbe/values/value.h"
#include "mongo/db/query/ce/histogram_predicate_estimation.h"
diff --git a/src/mongo/db/query/optimizer/SConscript b/src/mongo/db/query/optimizer/SConscript
index 80f144ee898..2abdccf1f04 100644
--- a/src/mongo/db/query/optimizer/SConscript
+++ b/src/mongo/db/query/optimizer/SConscript
@@ -150,7 +150,6 @@ env.CppUnitTest(
"interval_simplify_test.cpp",
],
LIBDEPS=[
- "$BUILD_DIR/mongo/db/concurrency/lock_manager",
"$BUILD_DIR/mongo/db/service_context_test_fixture",
"optimizer",
"unit_test_pipeline_utils",
diff --git a/src/mongo/db/repl/apply_ops.cpp b/src/mongo/db/repl/apply_ops.cpp
index 1fdf6450262..374ebb27ae9 100644
--- a/src/mongo/db/repl/apply_ops.cpp
+++ b/src/mongo/db/repl/apply_ops.cpp
@@ -35,6 +35,7 @@
#include "mongo/db/catalog/document_validation.h"
#include "mongo/db/client.h"
#include "mongo/db/concurrency/exception_util.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/curop.h"
#include "mongo/db/database_name.h"
#include "mongo/db/db_raii.h"
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index dece58c6c7c..c402aca5bdd 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -52,7 +52,7 @@
#include "mongo/db/commands.h"
#include "mongo/db/commands/feature_compatibility_version.h"
#include "mongo/db/concurrency/d_concurrency.h"
-#include "mongo/db/concurrency/lock_manager.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/concurrency/replication_state_transition_lock_guard.h"
#include "mongo/db/curop.h"
#include "mongo/db/curop_failpoint_helpers.h"
@@ -91,7 +91,6 @@
#include "mongo/db/serverless/serverless_operation_lock_registry.h"
#include "mongo/db/session/kill_sessions_local.h"
#include "mongo/db/session/session_catalog.h"
-#include "mongo/db/shard_role.h"
#include "mongo/db/shutdown_in_progress_quiesce_info.h"
#include "mongo/db/storage/control/journal_flusher.h"
#include "mongo/db/storage/storage_options.h"
@@ -2633,7 +2632,7 @@ ReplicationCoordinatorImpl::AutoGetRstlForStepUpStepDown::AutoGetRstlForStepUpSt
}
// Dump all locks to identify which thread(s) are holding RSTL.
- LockManager::get(opCtx)->dump();
+ getGlobalLockManager()->dump();
auto lockerInfo = opCtx->lockState()->getLockerInfo(CurOp::get(opCtx)->getLockStatsBase());
BSONObjBuilder lockRep;
diff --git a/src/mongo/db/repl/replication_coordinator_impl_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_test.cpp
index adfa65af6f7..ae89606f267 100644
--- a/src/mongo/db/repl/replication_coordinator_impl_test.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl_test.cpp
@@ -27,6 +27,9 @@
* it in the license file.
*/
+
+#include "mongo/platform/basic.h"
+
#include <functional>
#include <iostream>
#include <memory>
@@ -35,7 +38,7 @@
#include "mongo/bson/util/bson_extract.h"
#include "mongo/db/catalog/commit_quorum_options.h"
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/concurrency/replication_state_transition_lock_guard.h"
#include "mongo/db/read_write_concern_defaults.h"
#include "mongo/db/repl/bson_extract_optime.h"
@@ -80,6 +83,7 @@
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kTest
+
namespace mongo {
namespace repl {
namespace {
diff --git a/src/mongo/db/service_entry_point_mongod.cpp b/src/mongo/db/service_entry_point_mongod.cpp
index ecf95334f83..a09e32be199 100644
--- a/src/mongo/db/service_entry_point_mongod.cpp
+++ b/src/mongo/db/service_entry_point_mongod.cpp
@@ -27,10 +27,13 @@
* it in the license file.
*/
+
+#include "mongo/platform/basic.h"
+
#include "mongo/db/service_entry_point_mongod.h"
#include "mongo/db/commands/fsync_locked.h"
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/curop.h"
#include "mongo/db/read_concern.h"
#include "mongo/db/repl/repl_client_info.h"
@@ -50,6 +53,7 @@
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kCommand
+
namespace mongo {
class ServiceEntryPointMongod::Hooks final : public ServiceEntryPointCommon::Hooks {
diff --git a/src/mongo/db/shard_role.cpp b/src/mongo/db/shard_role.cpp
index 5a65652ee8a..4e5707931e3 100644
--- a/src/mongo/db/shard_role.cpp
+++ b/src/mongo/db/shard_role.cpp
@@ -40,8 +40,13 @@
#include "mongo/db/concurrency/exception_util.h"
#include "mongo/db/curop.h"
#include "mongo/db/db_raii.h"
+#include "mongo/db/namespace_string.h"
#include "mongo/db/repl/read_concern_args.h"
#include "mongo/db/s/collection_sharding_runtime.h"
+#include "mongo/db/s/collection_sharding_state.h"
+#include "mongo/db/s/database_sharding_state.h"
+#include "mongo/db/s/operation_sharding_state.h"
+#include "mongo/db/s/scoped_collection_metadata.h"
#include "mongo/db/storage/capped_snapshots.h"
#include "mongo/logv2/log.h"
#include "mongo/util/decorable.h"
diff --git a/src/mongo/db/shard_role.h b/src/mongo/db/shard_role.h
index e8a8b298e84..2d778d3049c 100644
--- a/src/mongo/db/shard_role.h
+++ b/src/mongo/db/shard_role.h
@@ -30,10 +30,10 @@
#pragma once
#include "mongo/db/catalog/collection_catalog.h"
-#include "mongo/db/s/collection_sharding_state.h"
-#include "mongo/db/s/database_sharding_state.h"
-#include "mongo/db/s/operation_sharding_state.h"
+#include "mongo/db/repl/read_concern_args.h"
+#include "mongo/db/s/scoped_collection_metadata.h"
#include "mongo/db/transaction_resources.h"
+#include "mongo/s/database_version.h"
namespace mongo {
diff --git a/src/mongo/db/storage/SConscript b/src/mongo/db/storage/SConscript
index eb04f974fb5..8f7b2f1e731 100644
--- a/src/mongo/db/storage/SConscript
+++ b/src/mongo/db/storage/SConscript
@@ -32,7 +32,7 @@ env.Library(
'snapshot_helper.cpp',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
+ '$BUILD_DIR/mongo/db/concurrency/lock_manager_defs',
'$BUILD_DIR/mongo/db/repl/read_concern_args',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
'$BUILD_DIR/mongo/db/server_base',
diff --git a/src/mongo/db/storage/kv/kv_drop_pending_ident_reaper_test.cpp b/src/mongo/db/storage/kv/kv_drop_pending_ident_reaper_test.cpp
index f0cbd2a0795..9b36ac2afd9 100644
--- a/src/mongo/db/storage/kv/kv_drop_pending_ident_reaper_test.cpp
+++ b/src/mongo/db/storage/kv/kv_drop_pending_ident_reaper_test.cpp
@@ -27,6 +27,11 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
+#include <memory>
+
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/service_context_test_fixture.h"
#include "mongo/db/storage/ident.h"
#include "mongo/db/storage/kv/kv_drop_pending_ident_reaper.h"
diff --git a/src/mongo/db/storage/storage_engine_init.cpp b/src/mongo/db/storage/storage_engine_init.cpp
index 76e88753b2b..6e2b2e23eec 100644
--- a/src/mongo/db/storage/storage_engine_init.cpp
+++ b/src/mongo/db/storage/storage_engine_init.cpp
@@ -27,13 +27,17 @@
* it in the license file.
*/
+
+#include "mongo/platform/basic.h"
+
#include "mongo/db/storage/storage_engine_init.h"
#include <map>
+#include <memory>
#include "mongo/base/init.h"
#include "mongo/bson/bsonobjbuilder.h"
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/storage/control/storage_control.h"
#include "mongo/db/storage/execution_control/concurrency_adjustment_parameters_gen.h"
@@ -55,7 +59,9 @@
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kStorage
+
namespace mongo {
+
namespace {
/**
* Creates the lock file used to prevent concurrent processes from accessing the data files,
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp
index 888935ca7e4..068e6d15098 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp
@@ -27,11 +27,15 @@
* it in the license file.
*/
-#include "mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h"
-#include "mongo/db/concurrency/locker.h"
+#include "mongo/platform/basic.h"
+
+#include <cstring>
+
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/repl/replication_coordinator.h"
#include "mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h"
+#include "mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h"
#include "mongo/db/storage/wiredtiger/wiredtiger_util.h"
#include "mongo/logv2/log.h"
#include "mongo/platform/mutex.h"
@@ -40,6 +44,7 @@
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kStorage
+
namespace mongo {
MONGO_FAIL_POINT_DEFINE(WTPauseOplogVisibilityUpdateLoop);
diff --git a/src/mongo/db/transaction/transaction_participant.cpp b/src/mongo/db/transaction/transaction_participant.cpp
index d31e7a5403d..2bba3023e3c 100644
--- a/src/mongo/db/transaction/transaction_participant.cpp
+++ b/src/mongo/db/transaction/transaction_participant.cpp
@@ -44,7 +44,8 @@
#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/concurrency/d_concurrency.h"
#include "mongo/db/concurrency/exception_util.h"
-#include "mongo/db/concurrency/locker_impl.h"
+#include "mongo/db/concurrency/lock_state.h"
+#include "mongo/db/concurrency/locker.h"
#include "mongo/db/concurrency/replication_state_transition_lock_guard.h"
#include "mongo/db/curop_failpoint_helpers.h"
#include "mongo/db/dbdirectclient.h"
diff --git a/src/mongo/db/transaction/transaction_participant_test.cpp b/src/mongo/db/transaction/transaction_participant_test.cpp
index 59c8d988c8f..54376f4cc6a 100644
--- a/src/mongo/db/transaction/transaction_participant_test.cpp
+++ b/src/mongo/db/transaction/transaction_participant_test.cpp
@@ -50,6 +50,7 @@
#include "mongo/db/session/session_catalog_mongod.h"
#include "mongo/db/session/session_txn_record_gen.h"
#include "mongo/db/shard_role.h"
+#include "mongo/db/stats/fill_locker_info.h"
#include "mongo/db/storage/durable_history_pin.h"
#include "mongo/db/transaction/server_transactions_metrics.h"
#include "mongo/db/transaction/session_catalog_mongod_transaction_interface_impl.h"
diff --git a/src/mongo/embedded/embedded.cpp b/src/mongo/embedded/embedded.cpp
index b746a2142a6..ee0fca37913 100644
--- a/src/mongo/embedded/embedded.cpp
+++ b/src/mongo/embedded/embedded.cpp
@@ -27,6 +27,9 @@
* it in the license file.
*/
+
+#include "mongo/platform/basic.h"
+
#include "mongo/embedded/embedded.h"
#include "mongo/base/initializer.h"
@@ -39,7 +42,7 @@
#include "mongo/db/client.h"
#include "mongo/db/commands/feature_compatibility_version.h"
#include "mongo/db/commands/fsync_locked.h"
-#include "mongo/db/concurrency/locker.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/dbdirectclient.h"
#include "mongo/db/global_settings.h"
#include "mongo/db/op_observer/op_observer_impl.h"
diff --git a/src/mongo/executor/SConscript b/src/mongo/executor/SConscript
index d071ae92c4c..587c4713785 100644
--- a/src/mongo/executor/SConscript
+++ b/src/mongo/executor/SConscript
@@ -435,7 +435,6 @@ env.CppIntegrationTest(
LIBDEPS=[
'$BUILD_DIR/mongo/client/async_client',
'$BUILD_DIR/mongo/client/clientdriver_network',
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/wire_version',
'$BUILD_DIR/mongo/executor/network_interface_factory',
'$BUILD_DIR/mongo/executor/network_interface_thread_pool',
diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript
index eb66d737ec7..16ad18b3854 100644
--- a/src/mongo/s/SConscript
+++ b/src/mongo/s/SConscript
@@ -619,7 +619,6 @@ env.Library(
],
LIBDEPS=[
'$BUILD_DIR/mongo/client/remote_command_targeter_mock',
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/service_context_test_fixture',
'$BUILD_DIR/mongo/executor/network_interface_mock',
'$BUILD_DIR/mongo/executor/network_test_env',
diff --git a/src/mongo/shell/SConscript b/src/mongo/shell/SConscript
index aa68e6a4c67..a8af390807f 100644
--- a/src/mongo/shell/SConscript
+++ b/src/mongo/shell/SConscript
@@ -320,7 +320,6 @@ if not has_option('noshell') and jsEngine:
# library to inject a static or mongo initializer to mongo,
# please add that library as a private libdep of
# mongo_initializers.
- "$BUILD_DIR/mongo/db/concurrency/lock_manager",
"$BUILD_DIR/mongo/s/write_ops/batch_write_types",
"$BUILD_DIR/mongo/transport/transport_layer",
"$BUILD_DIR/mongo/util/net/ssl_manager",
diff --git a/src/mongo/tools/mongobridge_tool/SConscript b/src/mongo/tools/mongobridge_tool/SConscript
index 6c9df84daf9..f917a686bd2 100644
--- a/src/mongo/tools/mongobridge_tool/SConscript
+++ b/src/mongo/tools/mongobridge_tool/SConscript
@@ -7,16 +7,15 @@ yamlEnv = env.Clone()
yamlEnv.InjectThirdParty(libraries=['yaml'])
mongobridge = env.Program(
- target='mongobridge',
+ target="mongobridge",
source=[
- 'bridge.cpp',
- 'bridge_commands.cpp',
- 'mongobridge_options.cpp',
- 'mongobridge_options.idl',
- 'mongobridge_options_init.cpp',
+ "bridge.cpp",
+ "bridge_commands.cpp",
+ "mongobridge_options.cpp",
+ "mongobridge_options.idl",
+ "mongobridge_options_init.cpp",
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/dbmessage',
'$BUILD_DIR/mongo/rpc/rpc',
'$BUILD_DIR/mongo/transport/message_compressor',
diff --git a/src/mongo/transport/SConscript b/src/mongo/transport/SConscript
index 64ae7d6d536..868890f48ba 100644
--- a/src/mongo/transport/SConscript
+++ b/src/mongo/transport/SConscript
@@ -285,7 +285,6 @@ env.Benchmark(
],
LIBDEPS=[
'$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/service_context_test_fixture',
'service_executor',
'transport_layer_mock',
@@ -298,7 +297,6 @@ env.Benchmark(
'session_workflow_bm.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/service_context_test_fixture',
'service_entry_point',
'service_executor',
diff --git a/src/mongo/unittest/SConscript b/src/mongo/unittest/SConscript
index 1e5e540a79c..0d1dfc44e67 100644
--- a/src/mongo/unittest/SConscript
+++ b/src/mongo/unittest/SConscript
@@ -63,7 +63,7 @@ env.Library(
)
env.Library(
- target='integration_test_main',
+ target="integration_test_main",
source=[
'integration_test_main.cpp',
'integration_test_main.idl',
@@ -75,7 +75,6 @@ env.Library(
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/client/connection_string',
'$BUILD_DIR/mongo/db/commands/test_commands_enabled',
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/server_options',
'$BUILD_DIR/mongo/db/server_options_base',
'$BUILD_DIR/mongo/db/serverinit',
diff --git a/src/mongo/util/concurrency/SConscript b/src/mongo/util/concurrency/SConscript
index e715ef3a9a8..acc81c451b4 100644
--- a/src/mongo/util/concurrency/SConscript
+++ b/src/mongo/util/concurrency/SConscript
@@ -41,20 +41,13 @@ env.Library(
],
)
-env.Library(
- target='admission_context',
- source=[
- 'admission_context.cpp',
- ],
- LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- ],
-)
+env.Library(target='admission_context', source=['admission_context.cpp'],
+ LIBDEPS=['$BUILD_DIR/mongo/base'])
env.Library(
target='spin_lock',
source=[
- 'spin_lock.cpp',
+ "spin_lock.cpp",
],
LIBDEPS=[
'$BUILD_DIR/mongo/base',
@@ -88,7 +81,6 @@ env.Benchmark(
'ticketholder_bm.cpp',
],
LIBDEPS=[
- '$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/service_context',
'ticketholder',
],
diff --git a/src/mongo/util/concurrency/priority_ticketholder.cpp b/src/mongo/util/concurrency/priority_ticketholder.cpp
index f99eb6a0331..4656c7ab4f4 100644
--- a/src/mongo/util/concurrency/priority_ticketholder.cpp
+++ b/src/mongo/util/concurrency/priority_ticketholder.cpp
@@ -27,11 +27,14 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
+#include "mongo/db/service_context.h"
+#include "mongo/util/concurrency/admission_context.h"
#include "mongo/util/concurrency/priority_ticketholder.h"
#include <iostream>
-#include "mongo/db/service_context.h"
#include "mongo/logv2/log.h"
#include "mongo/util/str.h"
diff --git a/src/mongo/util/concurrency/priority_ticketholder_test.cpp b/src/mongo/util/concurrency/priority_ticketholder_test.cpp
index 1bce5630521..fff70a982ec 100644
--- a/src/mongo/util/concurrency/priority_ticketholder_test.cpp
+++ b/src/mongo/util/concurrency/priority_ticketholder_test.cpp
@@ -30,6 +30,7 @@
#include "mongo/db/concurrency/locker_noop_client_observer.h"
#include "mongo/logv2/log.h"
#include "mongo/unittest/barrier.h"
+#include "mongo/util/concurrency/admission_context.h"
#include "mongo/util/concurrency/priority_ticketholder.h"
#include "mongo/util/concurrency/ticketholder_test_fixture.h"
#include "mongo/util/periodic_runner_factory.h"
diff --git a/src/mongo/util/concurrency/semaphore_ticketholder.cpp b/src/mongo/util/concurrency/semaphore_ticketholder.cpp
index f849a88b9ce..00517a0fd31 100644
--- a/src/mongo/util/concurrency/semaphore_ticketholder.cpp
+++ b/src/mongo/util/concurrency/semaphore_ticketholder.cpp
@@ -27,13 +27,16 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
+#include "mongo/db/service_context.h"
+#include "mongo/util/concurrency/admission_context.h"
#include "mongo/util/concurrency/semaphore_ticketholder.h"
+#include "mongo/util/concurrency/ticketholder.h"
#include <iostream>
-#include "mongo/db/service_context.h"
#include "mongo/logv2/log.h"
-#include "mongo/util/concurrency/ticketholder.h"
#include "mongo/util/str.h"
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kDefault
diff --git a/src/mongo/util/concurrency/ticketholder.cpp b/src/mongo/util/concurrency/ticketholder.cpp
index efc043ba816..dd527f9e177 100644
--- a/src/mongo/util/concurrency/ticketholder.cpp
+++ b/src/mongo/util/concurrency/ticketholder.cpp
@@ -28,13 +28,14 @@
*/
#include "mongo/util/concurrency/ticketholder.h"
-
-#include <iostream>
-
#include "mongo/db/service_context.h"
#include "mongo/db/storage/execution_control/concurrency_adjustment_parameters_gen.h"
#include "mongo/db/storage/storage_engine_feature_flags_gen.h"
#include "mongo/db/storage/storage_engine_parameters_gen.h"
+#include "mongo/util/concurrency/admission_context.h"
+
+#include <iostream>
+
#include "mongo/logv2/log.h"
#include "mongo/util/str.h"