summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/migration_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/migration_impl.cpp')
-rw-r--r--src/mongo/db/s/migration_impl.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/db/s/migration_impl.cpp b/src/mongo/db/s/migration_impl.cpp
index 873fc6c6f5c..d3dd4e30442 100644
--- a/src/mongo/db/s/migration_impl.cpp
+++ b/src/mongo/db/s/migration_impl.cpp
@@ -69,6 +69,7 @@ BSONObj createRecvChunkCommitRequest(const MigrationSessionId& sessionId) {
}
MONGO_FP_DECLARE(failMigrationCommit);
+MONGO_FP_DECLARE(hangBeforeCommitMigration);
MONGO_FP_DECLARE(hangBeforeLeavingCriticalSection);
} // namespace
@@ -133,12 +134,12 @@ Status ChunkMoveOperationState::initialize(const BSONObj& cmdObj) {
_toShardCS = toShard->getConnString();
}
- auto& operationVersion = OperationShardingState::get(_txn);
- if (!operationVersion.hasShardVersion()) {
+ auto& oss = OperationShardingState::get(_txn);
+ if (!oss.hasShardVersion()) {
return Status{ErrorCodes::InvalidOptions, "moveChunk command is missing shard version"};
}
- _collectionVersion = operationVersion.getShardVersion(_nss);
+ _collectionVersion = oss.getShardVersion(_nss);
return Status::OK();
}
@@ -385,6 +386,8 @@ Status ChunkMoveOperationState::commitMigration(const MigrationSessionId& sessio
preCond.append(b.obj());
}
+ MONGO_FAIL_POINT_PAUSE_WHILE_SET(hangBeforeCommitMigration);
+
fassertStatusOK(34431,
grid.catalogManager(_txn)->applyChunkOpsDeprecated(
_txn, updates.arr(), preCond.arr(), _nss.ns(), nextVersion));