summaryrefslogtreecommitdiff
path: root/src/mongo/db/write_concern.cpp
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2017-04-05 15:26:22 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2017-04-06 13:29:56 -0400
commit2cee2f8b7a20d94b5ba855bf9a3d9c86db640d3f (patch)
treeba02cfbc3fab9b116ddafe0d814eba51be149d1f /src/mongo/db/write_concern.cpp
parent155716fc56c840fb5608ddb9ba39c1143b69f6ba (diff)
downloadmongo-2cee2f8b7a20d94b5ba855bf9a3d9c86db640d3f.tar.gz
SERVER-28641 remove requirement that non-internal writes against config servers must use writeConcern 'majority'
Diffstat (limited to 'src/mongo/db/write_concern.cpp')
-rw-r--r--src/mongo/db/write_concern.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/mongo/db/write_concern.cpp b/src/mongo/db/write_concern.cpp
index 314ef6c05b6..99ceb5689be 100644
--- a/src/mongo/db/write_concern.cpp
+++ b/src/mongo/db/write_concern.cpp
@@ -106,21 +106,6 @@ Status validateWriteConcern(OperationContext* opCtx,
"cannot use 'j' option when a host does not have journaling enabled");
}
- // Remote callers of the config server (as in callers making network calls, not the internal
- // logic) should never be making non-majority writes against the config server, because sharding
- // is not resilient against rollbacks of metadata writes.
- if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer &&
- dbName != NamespaceString::kLocalDb && !writeConcern.validForConfigServers()) {
- // The only cases where we allow non-majority writes are from within the config servers
- // themselves, because these wait for write concern explicitly.
- if (!opCtx->getClient()->isInDirectClient()) {
- return {ErrorCodes::BadValue,
- str::stream() << "w:'majority' is the only valid write concern when writing "
- "to config servers, got: "
- << writeConcern.toBSON()};
- }
- }
-
const auto replMode = repl::ReplicationCoordinator::get(opCtx)->getReplicationMode();
if (replMode == repl::ReplicationCoordinator::modeNone && writeConcern.wNumNodes > 1) {