summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/migration_source_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/migration_source_manager.cpp')
-rw-r--r--src/mongo/db/s/migration_source_manager.cpp44
1 files changed, 14 insertions, 30 deletions
diff --git a/src/mongo/db/s/migration_source_manager.cpp b/src/mongo/db/s/migration_source_manager.cpp
index e292320ba53..022df3b0745 100644
--- a/src/mongo/db/s/migration_source_manager.cpp
+++ b/src/mongo/db/s/migration_source_manager.cpp
@@ -190,10 +190,8 @@ MigrationSourceManager::MigrationSourceManager(OperationContext* opCtx,
uassert(ErrorCodes::StaleEpoch,
str::stream() << "cannot move chunk " << _args.toString()
<< " because collection may have been dropped. "
- << "current epoch: "
- << collectionVersion.epoch()
- << ", cmd epoch: "
- << _args.getVersionEpoch(),
+ << "current epoch: " << collectionVersion.epoch()
+ << ", cmd epoch: " << _args.getVersionEpoch(),
_args.getVersionEpoch() == collectionVersion.epoch());
ChunkType chunkToMove;
@@ -228,9 +226,7 @@ Status MigrationSourceManager::startClone(OperationContext* opCtx) {
"moveChunk.start",
getNss().ns(),
BSON("min" << _args.getMinKey() << "max" << _args.getMaxKey() << "from"
- << _args.getFromShardId()
- << "to"
- << _args.getToShardId()),
+ << _args.getFromShardId() << "to" << _args.getToShardId()),
ShardingCatalogClient::kMajorityWriteConcern);
if (logStatus != Status::OK()) {
return logStatus;
@@ -452,9 +448,7 @@ Status MigrationSourceManager::commitChunkMetadataOnConfig(OperationContext* opC
"moveChunk.validating",
getNss().ns(),
BSON("min" << _args.getMinKey() << "max" << _args.getMaxKey() << "from"
- << _args.getFromShardId()
- << "to"
- << _args.getToShardId()),
+ << _args.getFromShardId() << "to" << _args.getToShardId()),
ShardingCatalogClient::kMajorityWriteConcern);
if ((ErrorCodes::isInterruption(status.code()) ||
@@ -487,12 +481,11 @@ Status MigrationSourceManager::commitChunkMetadataOnConfig(OperationContext* opC
}
fassert(40137,
- status.withContext(
- str::stream() << "Failed to commit migration for chunk " << _args.toString()
- << " due to "
- << redact(migrationCommitStatus)
- << ". Updating the optime with a write before refreshing the "
- << "metadata also failed"));
+ status.withContext(str::stream()
+ << "Failed to commit migration for chunk " << _args.toString()
+ << " due to " << redact(migrationCommitStatus)
+ << ". Updating the optime with a write before refreshing the "
+ << "metadata also failed"));
}
// Do a best effort attempt to incrementally refresh the metadata before leaving the critical
@@ -524,8 +517,7 @@ Status MigrationSourceManager::commitChunkMetadataOnConfig(OperationContext* opC
return migrationCommitStatus.withContext(
str::stream() << "Orphaned range not cleaned up. Failed to refresh metadata after"
" migration commit due to '"
- << refreshStatus.toString()
- << "' after commit failed");
+ << refreshStatus.toString() << "' after commit failed");
}
const auto refreshedMetadata = _getCurrentMetadataAndCheckEpoch(opCtx);
@@ -569,10 +561,7 @@ Status MigrationSourceManager::commitChunkMetadataOnConfig(OperationContext* opC
"moveChunk.commit",
getNss().ns(),
BSON("min" << _args.getMinKey() << "max" << _args.getMaxKey() << "from"
- << _args.getFromShardId()
- << "to"
- << _args.getToShardId()
- << "counts"
+ << _args.getFromShardId() << "to" << _args.getToShardId() << "counts"
<< _recipientCloneCounts),
ShardingCatalogClient::kMajorityWriteConcern);
@@ -632,9 +621,7 @@ void MigrationSourceManager::cleanupOnError(OperationContext* opCtx) {
"moveChunk.error",
getNss().ns(),
BSON("min" << _args.getMinKey() << "max" << _args.getMaxKey() << "from"
- << _args.getFromShardId()
- << "to"
- << _args.getToShardId()),
+ << _args.getFromShardId() << "to" << _args.getToShardId()),
ShardingCatalogClient::kMajorityWriteConcern);
try {
@@ -661,8 +648,7 @@ ScopedCollectionMetadata MigrationSourceManager::_getCurrentMetadataAndCheckEpoc
uassert(ErrorCodes::ConflictingOperationInProgress,
str::stream() << "The collection was dropped or recreated since the migration began. "
- << "Expected collection epoch: "
- << _collectionEpoch.toString()
+ << "Expected collection epoch: " << _collectionEpoch.toString()
<< ", but found: "
<< (metadata->isSharded() ? metadata->getCollVersion().epoch().toString()
: "unsharded collection."),
@@ -684,9 +670,7 @@ void MigrationSourceManager::_notifyChangeStreamsOnRecipientFirstChunk(
// The message expected by change streams
const auto o2Message = BSON("type"
<< "migrateChunkToNewShard"
- << "from"
- << _args.getFromShardId()
- << "to"
+ << "from" << _args.getFromShardId() << "to"
<< _args.getToShardId());
auto const serviceContext = opCtx->getClient()->getServiceContext();