summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/read_concern_args.h
diff options
context:
space:
mode:
authorKevin Pulo <kevin.pulo@mongodb.com>2019-10-21 11:59:09 +0000
committerevergreen <evergreen@mongodb.com>2019-10-21 11:59:09 +0000
commitc7e3ba1d4f415fb94eace24e1f94e5d4eb60456f (patch)
tree96638b25c046aaafe094bcfc8d666d21ae2a3332 /src/mongo/db/repl/read_concern_args.h
parent42c40db7ef341b3dbf2b975e61d87ce8000042a9 (diff)
downloadmongo-c7e3ba1d4f415fb94eace24e1f94e5d4eb60456f.tar.gz
SERVER-43123 SERVER-43124 Use ReadWriteConcernDefaults for incoming mongod requests
Diffstat (limited to 'src/mongo/db/repl/read_concern_args.h')
-rw-r--r--src/mongo/db/repl/read_concern_args.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/mongo/db/repl/read_concern_args.h b/src/mongo/db/repl/read_concern_args.h
index 310cfc59432..110624649bd 100644
--- a/src/mongo/db/repl/read_concern_args.h
+++ b/src/mongo/db/repl/read_concern_args.h
@@ -54,12 +54,6 @@ public:
static constexpr StringData kAtClusterTimeFieldName = "atClusterTime"_sd;
static constexpr StringData kLevelFieldName = "level"_sd;
- static constexpr StringData kLocalReadConcernStr = "local"_sd;
- static constexpr StringData kMajorityReadConcernStr = "majority"_sd;
- static constexpr StringData kLinearizableReadConcernStr = "linearizable"_sd;
- static constexpr StringData kAvailableReadConcernStr = "available"_sd;
- static constexpr StringData kSnapshotReadConcernStr = "snapshot"_sd;
-
/**
* Represents the internal mechanism an operation uses to satisfy 'majority' read concern.
*/
@@ -147,6 +141,13 @@ public:
bool isEmpty() const;
/**
+ * Returns true if this ReadConcernArgs represents a read concern that was actually specified.
+ * If the RC was specified as an empty BSON object this will still be true (unlike isEmpty()).
+ * False represents an absent or missing read concern, ie. one which wasn't present at all.
+ */
+ bool isSpecified() const;
+
+ /**
* Returns default kLocalReadConcern if _level is not set.
*/
ReadConcernLevel getLevel() const;
@@ -187,6 +188,12 @@ private:
* level is 'majority'.
*/
MajorityReadMechanism _majorityReadMechanism{MajorityReadMechanism::kMajoritySnapshot};
+
+ /**
+ * True indicates that a read concern has been specified (even if it might be empty), as
+ * opposed to being absent or missing.
+ */
+ bool _specified;
};
} // namespace repl