diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2022-09-13 09:25:41 +0200 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-09-13 07:56:04 +0000 |
commit | 5a6d6a46b809a2a35099b18e1ee693e70a67f28d (patch) | |
tree | 1fbf47921992293ee4ef9a188d7f1be25e168fce | |
parent | fbd732db079e78eab8ce12a0362b48abf1850822 (diff) | |
download | mongo-5a6d6a46b809a2a35099b18e1ee693e70a67f28d.tar.gz |
SERVER-69523 Allow METADATA and MUTEX locks during oplog hole
-rw-r--r-- | src/mongo/db/concurrency/lock_state.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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: " |