diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2020-12-04 03:35:20 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-12-04 04:21:32 +0000 |
commit | 0a2798959ac7712dfa8ddef89deefaca21f6ba10 (patch) | |
tree | 8c2240d43d5557be9a7066c1c5912c0122b5541e /src/mongo/db/ops | |
parent | 2851094f12d05f96fabe023abb9062f096557c02 (diff) | |
download | mongo-0a2798959ac7712dfa8ddef89deefaca21f6ba10.tar.gz |
SERVER-51088 Add ReshardingTest fixture for resharding fuzzer to use.
Diffstat (limited to 'src/mongo/db/ops')
-rw-r--r-- | src/mongo/db/ops/insert.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/db/ops/insert.cpp b/src/mongo/db/ops/insert.cpp index 1c6fd65b01a..65b2ce9e64e 100644 --- a/src/mongo/db/ops/insert.cpp +++ b/src/mongo/db/ops/insert.cpp @@ -38,6 +38,7 @@ #include "mongo/db/repl/replication_coordinator.h" #include "mongo/db/vector_clock_mutable.h" #include "mongo/db/views/durable_view_catalog.h" +#include "mongo/util/fail_point.h" #include "mongo/util/str.h" namespace mongo { @@ -45,6 +46,10 @@ namespace mongo { using std::string; namespace { + +// TODO SERVER-52795: Remove once the donor shards write the final oplog entry themselves. +MONGO_FAIL_POINT_DEFINE(allowDirectWritesToLiveOplog); + /** * Validates the nesting depth of 'obj', returning a non-OK status if it exceeds the limit. */ @@ -183,7 +188,8 @@ Status userAllowedWriteNS(const NamespaceString& ns) { serverGlobalParams.featureCompatibility.isGreaterThanOrEqualTo( ServerGlobalParams::FeatureCompatibility::Version::kVersion47)) || (ns.isOplog() && - repl::ReplicationCoordinator::get(getGlobalServiceContext())->isReplEnabled())) { + repl::ReplicationCoordinator::get(getGlobalServiceContext())->isReplEnabled() && + !MONGO_unlikely(allowDirectWritesToLiveOplog.shouldFail()))) { return Status(ErrorCodes::InvalidNamespace, str::stream() << "cannot write to " << ns); } return userAllowedCreateNS(ns); |