diff options
author | Kevin Pulo <kevin.pulo@mongodb.com> | 2019-11-29 08:59:07 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-11-29 08:59:07 +0000 |
commit | 81fd5d7451f804c978f70d9c890097ac15af9a08 (patch) | |
tree | 8655866841823459715fdb3c986a9e450791e100 /src/mongo/db/commands.h | |
parent | 6d9ad57515131568e8dafa7116b9fbdf4b0e7d13 (diff) | |
download | mongo-81fd5d7451f804c978f70d9c890097ac15af9a08.tar.gz |
SERVER-43712 mongos use ReadWriteConcernDefaults for RC
Diffstat (limited to 'src/mongo/db/commands.h')
-rw-r--r-- | src/mongo/db/commands.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h index 2350a040b6d..69ececd390c 100644 --- a/src/mongo/db/commands.h +++ b/src/mongo/db/commands.h @@ -484,9 +484,12 @@ public: * Returns this invocation's support for readConcern. */ virtual ReadConcernSupportResult supportsReadConcern(repl::ReadConcernLevel level) const { - return {{level != repl::ReadConcernLevel::kLocalReadConcern, - {ErrorCodes::InvalidOptions, "read concern not supported"}}, - {{ErrorCodes::InvalidOptions, "default read concern not permitted"}}}; + static const Status kReadConcernNotSupported{ErrorCodes::InvalidOptions, + "read concern not supported"}; + static const Status kDefaultReadConcernNotPermitted{ErrorCodes::InvalidOptions, + "default read concern not permitted"}; + return {{level != repl::ReadConcernLevel::kLocalReadConcern, kReadConcernNotSupported}, + {kDefaultReadConcernNotPermitted}}; } /** @@ -633,12 +636,14 @@ public: * the option to the shards as needed. We rely on the shards to fail the commands in the * cases where it isn't supported. */ - virtual ReadConcernSupportResult supportsReadConcern(const std::string& dbName, - const BSONObj& cmdObj, + virtual ReadConcernSupportResult supportsReadConcern(const BSONObj& cmdObj, repl::ReadConcernLevel level) const { - return {{level != repl::ReadConcernLevel::kLocalReadConcern, - {ErrorCodes::InvalidOptions, "read concern not supported"}}, - {{ErrorCodes::InvalidOptions, "default read concern not permitted"}}}; + static const Status kReadConcernNotSupported{ErrorCodes::InvalidOptions, + "read concern not supported"}; + static const Status kDefaultReadConcernNotPermitted{ErrorCodes::InvalidOptions, + "default read concern not permitted"}; + return {{level != repl::ReadConcernLevel::kLocalReadConcern, kReadConcernNotSupported}, + {kDefaultReadConcernNotPermitted}}; } virtual bool allowsAfterClusterTime(const BSONObj& cmdObj) const { |