From 5a6d6a46b809a2a35099b18e1ee693e70a67f28d Mon Sep 17 00:00:00 2001 From: Kaloian Manassiev Date: Tue, 13 Sep 2022 09:25:41 +0200 Subject: SERVER-69523 Allow METADATA and MUTEX locks during oplog hole --- src/mongo/db/concurrency/lock_state.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/concurrency') diff --git a/src/mongo/db/concurrency/lock_state.cpp b/src/mongo/db/concurrency/lock_state.cpp index 5a046bcdd07..69ea7d13bfd 100644 --- a/src/mongo/db/concurrency/lock_state.cpp +++ b/src/mongo/db/concurrency/lock_state.cpp @@ -856,7 +856,8 @@ LockResult LockerImpl::_lockBegin(OperationContext* opCtx, ResourceId resId, Loc dassert(!getWaitingResource().isValid()); // Operations which are holding open an oplog hole cannot block when acquiring locks. - if (opCtx && !shouldAllowLockAcquisitionOnTimestampedUnitOfWork()) { + if (opCtx && !shouldAllowLockAcquisitionOnTimestampedUnitOfWork() && + resId.getType() != RESOURCE_METADATA && resId.getType() != RESOURCE_MUTEX) { invariant(!opCtx->recoveryUnit()->isTimestamped(), str::stream() << "Operation holding open an oplog hole tried to acquire locks. ResourceId: " @@ -944,7 +945,8 @@ void LockerImpl::_lockComplete(OperationContext* opCtx, // Operations which are holding open an oplog hole cannot block when acquiring locks. Lock // requests entering this function have been queued up and will be granted the lock as soon as // the lock is released, which is a blocking operation. - if (opCtx && !shouldAllowLockAcquisitionOnTimestampedUnitOfWork()) { + if (opCtx && !shouldAllowLockAcquisitionOnTimestampedUnitOfWork() && + resId.getType() != RESOURCE_METADATA && resId.getType() != RESOURCE_MUTEX) { invariant(!opCtx->recoveryUnit()->isTimestamped(), str::stream() << "Operation holding open an oplog hole tried to acquire locks. ResourceId: " -- cgit v1.2.1