summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl
diff options
context:
space:
mode:
authorYu Jin Kang Park <yujin.kang@mongodb.com>2022-11-25 11:02:03 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-25 11:33:03 +0000
commitfe588e79d92b90eaf3a057e8fca78c0b8b8169fd (patch)
tree40d2e3d78e35af0fc2ee4e5fc37c7403b39e8f98 /src/mongo/db/repl
parent161677aca8bae3853e0d000afb65d6655b21fa7b (diff)
downloadmongo-fe588e79d92b90eaf3a057e8fca78c0b8b8169fd.tar.gz
SERVER-68867 Add simplecpplint check for UninterruptibleLockGuard
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r--src/mongo/db/repl/oplog_batcher.cpp2
-rw-r--r--src/mongo/db/repl/oplog_buffer_collection.cpp7
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp2
-rw-r--r--src/mongo/db/repl/storage_interface_impl.cpp3
4 files changed, 9 insertions, 5 deletions
diff --git a/src/mongo/db/repl/oplog_batcher.cpp b/src/mongo/db/repl/oplog_batcher.cpp
index f75c77f8845..ea6f86715a3 100644
--- a/src/mongo/db/repl/oplog_batcher.cpp
+++ b/src/mongo/db/repl/oplog_batcher.cpp
@@ -314,7 +314,7 @@ void OplogBatcher::_run(StorageInterface* storageInterface) {
// UninterruptibleLockGuard in batch application because the only cause of
// interruption would be shutdown, and the ReplBatcher thread has its own shutdown
// handling.
- UninterruptibleLockGuard noInterrupt(opCtx->lockState());
+ UninterruptibleLockGuard noInterrupt(opCtx->lockState()); // NOLINT.
// Locks the oplog to check its max size, do this in the UninterruptibleLockGuard.
batchLimits.bytes = getBatchLimitOplogBytes(opCtx.get(), storageInterface);
diff --git a/src/mongo/db/repl/oplog_buffer_collection.cpp b/src/mongo/db/repl/oplog_buffer_collection.cpp
index b31fa1cf96d..99dd1429751 100644
--- a/src/mongo/db/repl/oplog_buffer_collection.cpp
+++ b/src/mongo/db/repl/oplog_buffer_collection.cpp
@@ -459,7 +459,9 @@ void OplogBufferCollection::_createCollection(OperationContext* opCtx) {
// This oplog-like collection will benefit from clustering by _id to reduce storage engine
// overhead and improve _id query efficiency.
options.clusteredIndex = clustered_util::makeDefaultClusteredIdIndex();
- UninterruptibleLockGuard noInterrupt(opCtx->lockState());
+
+ // TODO (SERVER-71443): Fix to be interruptible or document exception.
+ UninterruptibleLockGuard noInterrupt(opCtx->lockState()); // NOLINT.
auto status = _storageInterface->createCollection(opCtx, _nss, options);
if (status.code() == ErrorCodes::NamespaceExists)
return;
@@ -467,7 +469,8 @@ void OplogBufferCollection::_createCollection(OperationContext* opCtx) {
}
void OplogBufferCollection::_dropCollection(OperationContext* opCtx) {
- UninterruptibleLockGuard noInterrupt(opCtx->lockState());
+ // TODO (SERVER-71443): Fix to be interruptible or document exception.
+ UninterruptibleLockGuard noInterrupt(opCtx->lockState()); // NOLINT.
uassertStatusOK(_storageInterface->dropCollection(opCtx, _nss));
}
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index 57c162eac46..4c589478c48 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -2854,7 +2854,7 @@ void ReplicationCoordinatorImpl::stepDown(OperationContext* opCtx,
// attempt, we might as well spend whatever time we need to acquire it now. For
// the same reason, we also disable lock acquisition interruption, to guarantee that
// we get the lock eventually.
- UninterruptibleLockGuard noInterrupt(opCtx->lockState());
+ UninterruptibleLockGuard noInterrupt(opCtx->lockState()); // NOLINT.
// Since we have released the RSTL lock at this point, there can be some read
// operations sneaked in here, that might hold global lock in S mode or blocked on
diff --git a/src/mongo/db/repl/storage_interface_impl.cpp b/src/mongo/db/repl/storage_interface_impl.cpp
index 98dd971cb8d..93096ff7b95 100644
--- a/src/mongo/db/repl/storage_interface_impl.cpp
+++ b/src/mongo/db/repl/storage_interface_impl.cpp
@@ -128,7 +128,8 @@ StatusWith<int> StorageInterfaceImpl::getRollbackID(OperationContext* opCtx) {
}
StatusWith<int> StorageInterfaceImpl::initializeRollbackID(OperationContext* opCtx) {
- UninterruptibleLockGuard noInterrupt(opCtx->lockState());
+ // TODO (SERVER-71443): Fix to be interruptible or document exception.
+ UninterruptibleLockGuard noInterrupt(opCtx->lockState()); // NOLINT.
auto status = createCollection(opCtx, _rollbackIdNss, CollectionOptions());
if (!status.isOK()) {
return status;