summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorAnton Oyung <anton.oyung@mongodb.com>2019-11-19 15:51:41 +0000
committerevergreen <evergreen@mongodb.com>2019-11-19 15:51:41 +0000
commit5b73c31741584597bae0455a50364513c05dc1d1 (patch)
tree34583e9b4a373ee8c2aab315a0bb8373d87d86b7 /src/mongo/db
parent0bed872351365fa35107e0d9818d9066642a84a4 (diff)
downloadmongo-5b73c31741584597bae0455a50364513c05dc1d1.tar.gz
SERVER-36439 Fix the concurrency control of the LogicalTimeValidator
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/logical_time_validator.cpp10
-rw-r--r--src/mongo/db/logical_time_validator.h2
2 files changed, 2 insertions, 10 deletions
diff --git a/src/mongo/db/logical_time_validator.cpp b/src/mongo/db/logical_time_validator.cpp
index df814663ff6..6d448f78a5f 100644
--- a/src/mongo/db/logical_time_validator.cpp
+++ b/src/mongo/db/logical_time_validator.cpp
@@ -173,7 +173,6 @@ void LogicalTimeValidator::init(ServiceContext* service) {
}
void LogicalTimeValidator::shutDown() {
- stdx::lock_guard<Latch> lk(_mutexKeyManager);
if (_keyManager) {
_keyManager->stopMonitoring();
}
@@ -197,18 +196,14 @@ bool LogicalTimeValidator::shouldGossipLogicalTime() {
void LogicalTimeValidator::resetKeyManagerCache() {
log() << "Resetting key manager cache";
- {
- stdx::lock_guard<Latch> keyManagerLock(_mutexKeyManager);
- invariant(_keyManager);
- _keyManager->clearCache();
- }
+ invariant(_keyManager);
+ _keyManager->clearCache();
stdx::lock_guard<Latch> lk(_mutex);
_lastSeenValidTime = SignedLogicalTime();
_timeProofService.resetCache();
}
void LogicalTimeValidator::stopKeyManager() {
- stdx::lock_guard<Latch> keyManagerLock(_mutexKeyManager);
if (_keyManager) {
log() << "Stopping key manager";
_keyManager->stopMonitoring();
@@ -223,7 +218,6 @@ void LogicalTimeValidator::stopKeyManager() {
}
std::shared_ptr<KeysCollectionManager> LogicalTimeValidator::_getKeyManagerCopy() {
- stdx::lock_guard<Latch> lk(_mutexKeyManager);
invariant(_keyManager);
return _keyManager;
}
diff --git a/src/mongo/db/logical_time_validator.h b/src/mongo/db/logical_time_validator.h
index e639b4435d8..1e8fbac9933 100644
--- a/src/mongo/db/logical_time_validator.h
+++ b/src/mongo/db/logical_time_validator.h
@@ -123,8 +123,6 @@ private:
SignedLogicalTime _getProof(const KeysCollectionDocument& keyDoc, LogicalTime newTime);
Mutex _mutex = MONGO_MAKE_LATCH("LogicalTimeValidator::_mutex"); // protects _lastSeenValidTime
- Mutex _mutexKeyManager =
- MONGO_MAKE_LATCH("LogicalTimevalidator::_mutexKeyManager"); // protects _keyManager
SignedLogicalTime _lastSeenValidTime;
TimeProofService _timeProofService;
std::shared_ptr<KeysCollectionManager> _keyManager;