summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp')
-rw-r--r--src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
index b2d8544b21a..7b891cf8e18 100644
--- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
+++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
@@ -292,7 +292,7 @@ Status MigrationChunkClonerSourceLegacy::startClone(OperationContext* opCtx) {
// between cancellations for different migration sessions. It is thus possible that a second
// migration from different donor, but the same recipient would certainly abort an already
// running migration.
- stdx::lock_guard<stdx::mutex> sl(_mutex);
+ stdx::lock_guard<Latch> sl(_mutex);
_state = kCloning;
return Status::OK();
@@ -321,7 +321,7 @@ Status MigrationChunkClonerSourceLegacy::awaitUntilCriticalSectionIsAppropriate(
}
iteration++;
- stdx::lock_guard<stdx::mutex> sl(_mutex);
+ stdx::lock_guard<Latch> sl(_mutex);
const std::size_t cloneLocsRemaining = _cloneLocs.size();
@@ -551,14 +551,14 @@ void MigrationChunkClonerSourceLegacy::_addToTransferModsQueue(
const repl::OpTime& prePostImageOpTime) {
switch (op) {
case 'd': {
- stdx::lock_guard<stdx::mutex> sl(_mutex);
+ stdx::lock_guard<Latch> sl(_mutex);
_deleted.push_back(idObj);
_memoryUsed += idObj.firstElement().size() + 5;
} break;
case 'i':
case 'u': {
- stdx::lock_guard<stdx::mutex> sl(_mutex);
+ stdx::lock_guard<Latch> sl(_mutex);
_reload.push_back(idObj);
_memoryUsed += idObj.firstElement().size() + 5;
} break;
@@ -574,7 +574,7 @@ void MigrationChunkClonerSourceLegacy::_addToTransferModsQueue(
}
bool MigrationChunkClonerSourceLegacy::_addedOperationToOutstandingOperationTrackRequests() {
- stdx::unique_lock<stdx::mutex> lk(_mutex);
+ stdx::unique_lock<Latch> lk(_mutex);
if (!_acceptingNewOperationTrackRequests) {
return false;
}
@@ -584,7 +584,7 @@ bool MigrationChunkClonerSourceLegacy::_addedOperationToOutstandingOperationTrac
}
void MigrationChunkClonerSourceLegacy::_drainAllOutstandingOperationTrackRequests(
- stdx::unique_lock<stdx::mutex>& lk) {
+ stdx::unique_lock<Latch>& lk) {
invariant(_state == kDone);
_acceptingNewOperationTrackRequests = false;
_allOutstandingOperationTrackRequestsDrained.wait(
@@ -598,7 +598,7 @@ void MigrationChunkClonerSourceLegacy::_incrementOutstandingOperationTrackReques
}
void MigrationChunkClonerSourceLegacy::_decrementOutstandingOperationTrackRequests() {
- stdx::lock_guard<stdx::mutex> sl(_mutex);
+ stdx::lock_guard<Latch> sl(_mutex);
--_outstandingOperationTrackRequests;
if (_outstandingOperationTrackRequests == 0) {
_allOutstandingOperationTrackRequestsDrained.notify_all();
@@ -606,7 +606,7 @@ void MigrationChunkClonerSourceLegacy::_decrementOutstandingOperationTrackReques
}
uint64_t MigrationChunkClonerSourceLegacy::getCloneBatchBufferAllocationSize() {
- stdx::lock_guard<stdx::mutex> sl(_mutex);
+ stdx::lock_guard<Latch> sl(_mutex);
return std::min(static_cast<uint64_t>(BSONObjMaxUserSize),
_averageObjectSizeForCloneLocs * _cloneLocs.size());
@@ -621,7 +621,7 @@ Status MigrationChunkClonerSourceLegacy::nextCloneBatch(OperationContext* opCtx,
internalQueryExecYieldIterations.load(),
Milliseconds(internalQueryExecYieldPeriodMS.load()));
- stdx::unique_lock<stdx::mutex> lk(_mutex);
+ stdx::unique_lock<Latch> lk(_mutex);
auto iter = _cloneLocs.begin();
for (; iter != _cloneLocs.end(); ++iter) {
@@ -666,7 +666,7 @@ Status MigrationChunkClonerSourceLegacy::nextModsBatch(OperationContext* opCtx,
{
// All clone data must have been drained before starting to fetch the incremental changes.
- stdx::unique_lock<stdx::mutex> lk(_mutex);
+ stdx::unique_lock<Latch> lk(_mutex);
invariant(_cloneLocs.empty());
// The "snapshot" for delete and update list must be taken under a single lock. This is to
@@ -685,7 +685,7 @@ Status MigrationChunkClonerSourceLegacy::nextModsBatch(OperationContext* opCtx,
builder->append("size", totalDocSize);
// Put back remaining ids we didn't consume
- stdx::unique_lock<stdx::mutex> lk(_mutex);
+ stdx::unique_lock<Latch> lk(_mutex);
_deleted.splice(_deleted.cbegin(), deleteList);
_reload.splice(_reload.cbegin(), updateList);
@@ -693,7 +693,7 @@ Status MigrationChunkClonerSourceLegacy::nextModsBatch(OperationContext* opCtx,
}
void MigrationChunkClonerSourceLegacy::_cleanup(OperationContext* opCtx) {
- stdx::unique_lock<stdx::mutex> lk(_mutex);
+ stdx::unique_lock<Latch> lk(_mutex);
_state = kDone;
_drainAllOutstandingOperationTrackRequests(lk);
@@ -800,7 +800,7 @@ Status MigrationChunkClonerSourceLegacy::_storeCurrentLocs(OperationContext* opC
}
if (!isLargeChunk) {
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
_cloneLocs.insert(recordId);
}
@@ -829,7 +829,7 @@ Status MigrationChunkClonerSourceLegacy::_storeCurrentLocs(OperationContext* opC
<< _args.getMaxKey()};
}
- stdx::lock_guard<stdx::mutex> lk(_mutex);
+ stdx::lock_guard<Latch> lk(_mutex);
_averageObjectSizeForCloneLocs = collectionAverageObjectSize + 12;
return Status::OK();