summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2020-07-09 15:42:13 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-10 18:38:02 +0000
commit8296b34e798ac4d3879f2f2c8216ef3f17ced1cc (patch)
tree91243fa60739c5c23357870cf626e834b5c5f6da
parent4e358e0a229c517295fd8b823b0fc33741abb36f (diff)
downloadmongo-8296b34e798ac4d3879f2f2c8216ef3f17ced1cc.tar.gz
SERVER-48165 add warning comments about changing replicated temporary collection names
-rw-r--r--src/mongo/db/catalog/rename_collection.cpp3
-rw-r--r--src/mongo/db/pipeline/document_source_out.cpp2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/rename_collection.cpp b/src/mongo/db/catalog/rename_collection.cpp
index 69ceb35a556..f1f259f1410 100644
--- a/src/mongo/db/catalog/rename_collection.cpp
+++ b/src/mongo/db/catalog/rename_collection.cpp
@@ -545,6 +545,9 @@ Status renameBetweenDBs(OperationContext* opCtx,
// The generated unique collection name is only guaranteed to exist if the database is
// exclusively locked.
invariant(opCtx->lockState()->isDbLockedForMode(targetDB->name(), LockMode::MODE_X));
+
+ // Note that this temporary collection name is used by MongoMirror and thus must not be changed
+ // without consultation.
auto tmpNameResult =
targetDB->makeUniqueCollectionNamespace(opCtx, "tmp%%%%%.renameCollection");
if (!tmpNameResult.isOK()) {
diff --git a/src/mongo/db/pipeline/document_source_out.cpp b/src/mongo/db/pipeline/document_source_out.cpp
index 093ede06089..bdb2991d146 100644
--- a/src/mongo/db/pipeline/document_source_out.cpp
+++ b/src/mongo/db/pipeline/document_source_out.cpp
@@ -108,6 +108,8 @@ void DocumentSourceOut::initialize() {
const auto& outputNs = getOutputNs();
// We will write all results into a temporary collection, then rename the temporary collection
// to be the target collection once we are done.
+ // Note that this temporary collection name is used by MongoMirror and thus should not be
+ // changed without consultation.
_tempNs = NamespaceString(str::stream() << outputNs.db() << ".tmp.agg_out." << UUID::gen());
// Save the original collection options and index specs so we can check they didn't change