summaryrefslogtreecommitdiff
path: root/src/mongo/db/cloner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/cloner.cpp')
-rw-r--r--src/mongo/db/cloner.cpp43
1 files changed, 15 insertions, 28 deletions
diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp
index bf6387956ed..f79fa7067c3 100644
--- a/src/mongo/db/cloner.cpp
+++ b/src/mongo/db/cloner.cpp
@@ -132,8 +132,7 @@ struct Cloner::Fun {
uassert(
ErrorCodes::NotMaster,
str::stream() << "Not primary while cloning collection " << from_collection.ns()
- << " to "
- << to_collection.ns(),
+ << " to " << to_collection.ns(),
!opCtx->writesAreReplicated() ||
repl::ReplicationCoordinator::get(opCtx)->canAcceptWritesFor(opCtx, to_collection));
@@ -163,13 +162,12 @@ struct Cloner::Fun {
db->userCreateNS(
opCtx, to_collection, collectionOptions, createDefaultIndexes, indexSpec),
str::stream() << "collection creation failed during clone ["
- << to_collection.ns()
- << "]");
+ << to_collection.ns() << "]");
wunit.commit();
collection = db->getCollection(opCtx, to_collection);
invariant(collection,
- str::stream() << "Missing collection during clone [" << to_collection.ns()
- << "]");
+ str::stream()
+ << "Missing collection during clone [" << to_collection.ns() << "]");
});
}
@@ -209,8 +207,8 @@ struct Cloner::Fun {
collection = db->getCollection(opCtx, to_collection);
uassert(28594,
- str::stream() << "Collection " << to_collection.ns()
- << " dropped while cloning",
+ str::stream()
+ << "Collection " << to_collection.ns() << " dropped while cloning",
collection != NULL);
}
@@ -292,7 +290,7 @@ struct Cloner::Fun {
};
/* copy the specified collection
-*/
+ */
void Cloner::copy(OperationContext* opCtx,
const string& toDBName,
const NamespaceString& from_collection,
@@ -326,10 +324,7 @@ void Cloner::copy(OperationContext* opCtx,
uassert(ErrorCodes::PrimarySteppedDown,
str::stream() << "Not primary while cloning collection " << from_collection.ns()
- << " to "
- << to_collection.ns()
- << " with filter "
- << query.toString(),
+ << " to " << to_collection.ns() << " with filter " << query.toString(),
!opCtx->writesAreReplicated() ||
repl::ReplicationCoordinator::get(opCtx)->canAcceptWritesFor(opCtx, to_collection));
}
@@ -350,9 +345,7 @@ void Cloner::copyIndexes(OperationContext* opCtx,
uassert(ErrorCodes::PrimarySteppedDown,
str::stream() << "Not primary while copying indexes from " << from_collection.ns()
- << " to "
- << to_collection.ns()
- << " (Cloner)",
+ << " to " << to_collection.ns() << " (Cloner)",
!opCtx->writesAreReplicated() ||
repl::ReplicationCoordinator::get(opCtx)->canAcceptWritesFor(opCtx, to_collection));
@@ -381,11 +374,9 @@ void Cloner::copyIndexes(OperationContext* opCtx,
createDefaultIndexes,
fixIndexSpec(to_collection.db().toString(),
getIdIndexSpec(from_indexes))),
- str::stream() << "Collection creation failed while copying indexes from "
- << from_collection.ns()
- << " to "
- << to_collection.ns()
- << " (Cloner)");
+ str::stream()
+ << "Collection creation failed while copying indexes from "
+ << from_collection.ns() << " to " << to_collection.ns() << " (Cloner)");
wunit.commit();
collection = db->getCollection(opCtx, to_collection);
invariant(collection,
@@ -602,8 +593,7 @@ Status Cloner::createCollectionsForDb(
// we're trying to create already exists.
return Status(ErrorCodes::NamespaceExists,
str::stream() << "unsharded collection with same namespace "
- << nss.ns()
- << " already exists.");
+ << nss.ns() << " already exists.");
}
// If the collection is sharded and a collection with the same name already
@@ -625,12 +615,9 @@ Status Cloner::createCollectionsForDb(
return Status(
ErrorCodes::InvalidOptions,
str::stream()
- << "sharded collection with same namespace "
- << nss.ns()
+ << "sharded collection with same namespace " << nss.ns()
<< " already exists, but options don't match. Existing options are "
- << existingOpts
- << " and new options are "
- << options);
+ << existingOpts << " and new options are " << options);
}
// If the collection does not already exist and is sharded, we create a new