diff options
author | Geert Bosch <geert@mongodb.com> | 2019-04-12 13:27:54 -0400 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2019-04-15 11:24:05 -0400 |
commit | 688948927bedd25c4c5c50bc7e6a253feeec4e25 (patch) | |
tree | c1beee18d1d6acf197455542a0328f0190f8dc70 /src/mongo/db/index_builds_coordinator.cpp | |
parent | 03171bed9efdf0d25054fcddd936ad04db53f4aa (diff) | |
download | mongo-688948927bedd25c4c5c50bc7e6a253feeec4e25.tar.gz |
SERVER-40604 Make CollectionLock interruptible
Diffstat (limited to 'src/mongo/db/index_builds_coordinator.cpp')
-rw-r--r-- | src/mongo/db/index_builds_coordinator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/index_builds_coordinator.cpp b/src/mongo/db/index_builds_coordinator.cpp index 245e48abd0e..1bf3ef9ab12 100644 --- a/src/mongo/db/index_builds_coordinator.cpp +++ b/src/mongo/db/index_builds_coordinator.cpp @@ -846,7 +846,7 @@ void IndexBuildsCoordinator::_buildIndex(OperationContext* opCtx, // Collection scan and insert into index, followed by a drain of writes received in the // background. { - Lock::CollectionLock colLock(opCtx->lockState(), nss.ns(), MODE_IX); + Lock::CollectionLock colLock(opCtx, nss.ns(), MODE_IX); uassertStatusOK( _indexBuildsManager.startBuildingIndex(opCtx, collection, replState->buildUUID)); } @@ -859,7 +859,7 @@ void IndexBuildsCoordinator::_buildIndex(OperationContext* opCtx, // Perform the first drain while holding an intent lock. { opCtx->recoveryUnit()->abandonSnapshot(); - Lock::CollectionLock colLock(opCtx->lockState(), nss.ns(), MODE_IS); + Lock::CollectionLock colLock(opCtx, nss.ns(), MODE_IS); // Read at a point in time so that the drain, which will timestamp writes at lastApplied, // can never commit writes earlier than its read timestamp. @@ -875,7 +875,7 @@ void IndexBuildsCoordinator::_buildIndex(OperationContext* opCtx, // Perform the second drain while stopping writes on the collection. { opCtx->recoveryUnit()->abandonSnapshot(); - Lock::CollectionLock colLock(opCtx->lockState(), nss.ns(), MODE_S); + Lock::CollectionLock colLock(opCtx, nss.ns(), MODE_S); uassertStatusOK(_indexBuildsManager.drainBackgroundWrites( opCtx, replState->buildUUID, RecoveryUnit::ReadSource::kUnset)); |