summaryrefslogtreecommitdiff
path: root/src/mongo/db/transaction_validation.h
diff options
context:
space:
mode:
authorKevin Pulo <kevin.pulo@mongodb.com>2019-11-29 08:59:07 +0000
committerevergreen <evergreen@mongodb.com>2019-11-29 08:59:07 +0000
commit81fd5d7451f804c978f70d9c890097ac15af9a08 (patch)
tree8655866841823459715fdb3c986a9e450791e100 /src/mongo/db/transaction_validation.h
parent6d9ad57515131568e8dafa7116b9fbdf4b0e7d13 (diff)
downloadmongo-81fd5d7451f804c978f70d9c890097ac15af9a08.tar.gz
SERVER-43712 mongos use ReadWriteConcernDefaults for RC
Diffstat (limited to 'src/mongo/db/transaction_validation.h')
-rw-r--r--src/mongo/db/transaction_validation.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mongo/db/transaction_validation.h b/src/mongo/db/transaction_validation.h
index 2e57866eeb1..f2447f6ab3a 100644
--- a/src/mongo/db/transaction_validation.h
+++ b/src/mongo/db/transaction_validation.h
@@ -30,14 +30,16 @@
#pragma once
#include "mongo/db/logical_session_id.h"
+#include "mongo/db/repl/read_concern_level.h"
#include "mongo/db/write_concern_options.h"
namespace mongo {
/**
- * Returns true if the given cmd name is allowed to specify write concern in a transaction.
+ * Returns true if the given cmd name is a transaction control command. These are also the only
+ * commands allowed to specify write concern in a transaction.
*/
-bool commandSupportsWriteConcernInTransaction(StringData cmdName);
+bool isTransactionCommand(StringData cmdName);
/**
* Throws if the given write concern is not allowed in a transaction.
@@ -45,6 +47,11 @@ bool commandSupportsWriteConcernInTransaction(StringData cmdName);
void validateWriteConcernForTransaction(const WriteConcernOptions& wcResult, StringData cmdName);
/**
+ * Returns true if the given readConcern level is valid for use in a transaction.
+ */
+bool isReadConcernLevelAllowedInTransaction(repl::ReadConcernLevel readConcernLevel);
+
+/**
* Returns true if the given command is one of the commands that does not check out a session
* regardless of its session options, e.g. two-phase commit commands.
*/