diff options
author | Eric Milkie <milkie@10gen.com> | 2017-11-08 13:49:03 -0500 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2017-11-09 08:33:16 -0500 |
commit | 1b41f97e03fcbf0201f791b7b5dd510cc7435cc6 (patch) | |
tree | cd6d9639dafb825e17bdbbfbde9cf1250ed54a3f | |
parent | 6889e9fc52241b9e9976926ded29ba917abe714b (diff) | |
download | mongo-1b41f97e03fcbf0201f791b7b5dd510cc7435cc6.tar.gz |
SERVER-31879 remove unused synchronization in oplog
-rw-r--r-- | src/mongo/db/concurrency/d_concurrency.cpp | 5 | ||||
-rw-r--r-- | src/mongo/db/concurrency/d_concurrency.h | 7 | ||||
-rw-r--r-- | src/mongo/db/concurrency/lock_manager_defs.h | 8 | ||||
-rw-r--r-- | src/mongo/db/concurrency/lock_state.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/repl/oplog.cpp | 1 |
5 files changed, 0 insertions, 23 deletions
diff --git a/src/mongo/db/concurrency/d_concurrency.cpp b/src/mongo/db/concurrency/d_concurrency.cpp index 0876f5f4f8e..74608ab12f6 100644 --- a/src/mongo/db/concurrency/d_concurrency.cpp +++ b/src/mongo/db/concurrency/d_concurrency.cpp @@ -311,9 +311,4 @@ void Lock::ResourceLock::unlock() { } } -void synchronizeOnOplogInFlightResource(Locker* lockState) { - dassert(lockState->inAWriteUnitOfWork()); - Lock::ResourceLock heldUntilEndOfWUOW{lockState, resourceInFlightForOplog, MODE_IX}; -} - } // namespace mongo diff --git a/src/mongo/db/concurrency/d_concurrency.h b/src/mongo/db/concurrency/d_concurrency.h index 6b0cf4e9547..a3e18176949 100644 --- a/src/mongo/db/concurrency/d_concurrency.h +++ b/src/mongo/db/concurrency/d_concurrency.h @@ -381,11 +381,4 @@ public: const bool _orginalShouldConflict; }; }; - -/** - * Takes a lock on resourceCappedInFlight in MODE_IX which will be held until the end of your - * WUOW. This ensures that a MODE_X lock on this resource will wait for all in-flight oplog - * inserts to either commit or rollback and block new ones from starting. - */ -void synchronizeOnOplogInFlightResource(Locker* opCtx); } diff --git a/src/mongo/db/concurrency/lock_manager_defs.h b/src/mongo/db/concurrency/lock_manager_defs.h index 5951955eeb1..6edb5832fbd 100644 --- a/src/mongo/db/concurrency/lock_manager_defs.h +++ b/src/mongo/db/concurrency/lock_manager_defs.h @@ -188,7 +188,6 @@ public: SINGLETON_PARALLEL_BATCH_WRITER_MODE, SINGLETON_GLOBAL, SINGLETON_MMAPV1_FLUSH, - SINGLETON_IN_FLIGHT_OPLOG, }; ResourceId() : _fullHash(0) {} @@ -264,13 +263,6 @@ extern const ResourceId resourceIdAdminDB; // TODO: Merge this with resourceIdGlobal extern const ResourceId resourceIdParallelBatchWriterMode; -// Every place that starts oplog inserts takes this lock in MODE_IX and holds it -// until the end of their WriteUnitOfWork. -// -// Threads that need a consistent view of the world can lock this in MODE_X to prevent -// concurrent in-flight oplog inserts. -extern const ResourceId resourceInFlightForOplog; - /** * Interface on which granted lock requests will be notified. See the contract for the notify * method for more information and also the LockManager::lock call. diff --git a/src/mongo/db/concurrency/lock_state.cpp b/src/mongo/db/concurrency/lock_state.cpp index 3c7b9f92a56..2b5133e34a6 100644 --- a/src/mongo/db/concurrency/lock_state.cpp +++ b/src/mongo/db/concurrency/lock_state.cpp @@ -969,7 +969,5 @@ const ResourceId resourceIdOplog = ResourceId(RESOURCE_COLLECTION, StringData("l const ResourceId resourceIdAdminDB = ResourceId(RESOURCE_DATABASE, StringData("admin")); const ResourceId resourceIdParallelBatchWriterMode = ResourceId(RESOURCE_GLOBAL, ResourceId::SINGLETON_PARALLEL_BATCH_WRITER_MODE); -const ResourceId resourceInFlightForOplog = - ResourceId(RESOURCE_METADATA, ResourceId::SINGLETON_IN_FLIGHT_OPLOG); } // namespace mongo diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp index a672dfeb788..dcc54adf696 100644 --- a/src/mongo/db/repl/oplog.cpp +++ b/src/mongo/db/repl/oplog.cpp @@ -148,7 +148,6 @@ void _getNextOpTimes(OperationContext* opCtx, Collection* oplog, std::size_t count, OplogSlot* slotsOut) { - synchronizeOnOplogInFlightResource(opCtx->lockState()); auto replCoord = ReplicationCoordinator::get(opCtx); long long term = OpTime::kUninitializedTerm; |