summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl
diff options
context:
space:
mode:
authorJosef Ahmad <josef.ahmad@mongodb.com>2022-01-13 11:21:43 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-13 12:12:05 +0000
commit5a1dbe698bf88ef3f0ce2348c705d6a042c32011 (patch)
tree770e9b2da7fdb55d4b204d69b7b72334e8ccccc8 /src/mongo/db/repl
parent546d77f0945fabc0fc485e762bd7548871ffc601 (diff)
downloadmongo-5a1dbe698bf88ef3f0ce2348c705d6a042c32011.tar.gz
SERVER-61709 Introduce implicitly replicated namespaces
Implicitly replicated namespaces are internal namespaces that do not replicate writes, with the exception of deletions, user-initiated direct writes and some maintenance operations. This patch lists config.system.preimages, config.images_collection, config.transactions and config.changes.* as implicitly replicated namespaces, and unifies and validates their semantics. It also special-cases some of the config.transactions replication behaviour that is too specific to be generalised.
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r--src/mongo/db/repl/dbcheck.cpp3
-rw-r--r--src/mongo/db/repl/oplog.cpp1
2 files changed, 1 insertions, 3 deletions
diff --git a/src/mongo/db/repl/dbcheck.cpp b/src/mongo/db/repl/dbcheck.cpp
index 79a98205972..cb909bbd08e 100644
--- a/src/mongo/db/repl/dbcheck.cpp
+++ b/src/mongo/db/repl/dbcheck.cpp
@@ -206,8 +206,7 @@ std::unique_ptr<HealthLogEntry> dbCheckBatchEntry(
}
// Implcitily replicated collections and capped collections not replicating truncation are
// not designed to be consistent, so inconsistency is not necessarily pathological.
- if (nss.isChangeStreamPreImagesCollection() || nss.isConfigImagesCollection() ||
- (options && options->capped)) {
+ if (nss.isImplicitlyReplicated() || (options && options->capped)) {
return SeverityEnum::Warning;
}
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index ea9b83dc41b..ec5933b830d 100644
--- a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -297,7 +297,6 @@ void writeToImageCollection(OperationContext* opCtx,
request.setFromOplogApplication(true);
try {
// This code path can also be hit by things such as `applyOps` and tenant migrations.
- repl::UnreplicatedWritesBlock dontReplicate(opCtx);
::mongo::update(opCtx, autoColl.getDb(), request);
} catch (const ExceptionFor<ErrorCodes::DuplicateKey>&) {
// We can get a duplicate key when two upserts race on inserting a document.