From ea0f5e7a4517404725aebbad5fb2ec2d53e5aa9f Mon Sep 17 00:00:00 2001 From: Kevin Pulo Date: Thu, 16 Jan 2020 02:02:52 +0000 Subject: SERVER-45098 test that RWC defaults are correctly applied to commands --- src/mongo/db/commands.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/commands.h') diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h index efc4230556f..b993a6b737c 100644 --- a/src/mongo/db/commands.h +++ b/src/mongo/db/commands.h @@ -146,9 +146,11 @@ struct CommandHelpers { const BSONObj& request); /** - * Returns a copy of 'cmdObj' with a majority writeConcern appended. + * Returns a copy of 'cmdObj' with a majority writeConcern appended. If the command object does + * not contain a writeConcern, 'defaultWC' will be used instead, if supplied. */ - static BSONObj appendMajorityWriteConcern(const BSONObj& cmdObj); + static BSONObj appendMajorityWriteConcern( + const BSONObj& cmdObj, WriteConcernOptions defaultWC = WriteConcernOptions()); /** * Rewrites cmdObj into a format safe to blindly forward to shards. -- cgit v1.2.1