diff options
author | Esha Maharishi <esha.maharishi@mongodb.com> | 2017-04-05 15:26:22 -0400 |
---|---|---|
committer | Esha Maharishi <esha.maharishi@mongodb.com> | 2017-04-06 13:29:56 -0400 |
commit | 2cee2f8b7a20d94b5ba855bf9a3d9c86db640d3f (patch) | |
tree | ba02cfbc3fab9b116ddafe0d814eba51be149d1f /src/mongo/db/write_concern.cpp | |
parent | 155716fc56c840fb5608ddb9ba39c1143b69f6ba (diff) | |
download | mongo-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.cpp | 15 |
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) { |