summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/repl/replication_coordinator.h4
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/repl/replication_coordinator.h b/src/mongo/db/repl/replication_coordinator.h
index 8d109bf4be9..b61b2e71495 100644
--- a/src/mongo/db/repl/replication_coordinator.h
+++ b/src/mongo/db/repl/replication_coordinator.h
@@ -214,8 +214,8 @@ public:
* will not be able to receive writes to a database other than local (it will not be
* treated as standalone node).
*
- * NOTE: This function can only be meaningfully called while the caller holds the global
- * lock in some mode other than MODE_NONE.
+ * NOTE: This function can only be meaningfully called while the caller holds the
+ * ReplicationStateTransitionLock in some mode other than MODE_NONE.
*/
virtual bool canAcceptWritesForDatabase(OperationContext* opCtx, StringData dbName) = 0;
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index f003bfdba66..3becf53450a 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -2050,8 +2050,8 @@ bool ReplicationCoordinatorImpl::isMasterForReportingPurposes() {
bool ReplicationCoordinatorImpl::canAcceptWritesForDatabase(OperationContext* opCtx,
StringData dbName) {
- // The answer isn't meaningful unless we hold the global lock.
- invariant(opCtx->lockState()->isLocked());
+ // The answer isn't meaningful unless we hold the ReplicationStateTransitionLock.
+ invariant(opCtx->lockState()->isRSTLLocked());
return canAcceptWritesForDatabase_UNSAFE(opCtx, dbName);
}
@@ -2073,7 +2073,7 @@ bool ReplicationCoordinatorImpl::canAcceptWritesForDatabase_UNSAFE(OperationCont
bool ReplicationCoordinatorImpl::canAcceptWritesFor(OperationContext* opCtx,
const NamespaceString& ns) {
- invariant(opCtx->lockState()->isLocked());
+ invariant(opCtx->lockState()->isRSTLLocked());
return canAcceptWritesFor_UNSAFE(opCtx, ns);
}
@@ -2109,7 +2109,7 @@ bool ReplicationCoordinatorImpl::canAcceptWritesFor_UNSAFE(OperationContext* opC
Status ReplicationCoordinatorImpl::checkCanServeReadsFor(OperationContext* opCtx,
const NamespaceString& ns,
bool slaveOk) {
- invariant(opCtx->lockState()->isLocked());
+ invariant(opCtx->lockState()->isRSTLLocked());
return checkCanServeReadsFor_UNSAFE(opCtx, ns, slaveOk);
}