summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/read_concern_args.h
diff options
context:
space:
mode:
authorWilliam Schultz <william.schultz@mongodb.com>2018-12-21 16:33:35 -0500
committerWilliam Schultz <william.schultz@mongodb.com>2018-12-21 16:43:58 -0500
commitf15556ae1ba4f78d2823d54e38d7025c7e9ca4fb (patch)
tree74207795633775a6cd080534c0ea29693bc9a682 /src/mongo/db/repl/read_concern_args.h
parent7b85fb049b087fbcb04d6f356a0f7bee9ef48190 (diff)
downloadmongo-f15556ae1ba4f78d2823d54e38d7025c7e9ca4fb.tar.gz
SERVER-37560 Add core functionality for speculative majority reads
This patch adds functionality for "speculative" majority reads. These are reads that can satisfy "majority" read concern guarantees without support from the storage engine for reading from a historical snapshot. Queries of this nature will, by default, wait on the most recent lastApplied optime to majority commit after they complete, but before returning to the client. They can also optionally set a custom optime T to wait on, if they know that they did not read any data that reflects the effects of operations newer than optime T.
Diffstat (limited to 'src/mongo/db/repl/read_concern_args.h')
-rw-r--r--src/mongo/db/repl/read_concern_args.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/repl/read_concern_args.h b/src/mongo/db/repl/read_concern_args.h
index 9cd82318aa1..773ff2d6641 100644
--- a/src/mongo/db/repl/read_concern_args.h
+++ b/src/mongo/db/repl/read_concern_args.h
@@ -125,6 +125,11 @@ public:
MajorityReadMechanism getMajorityReadMechanism() const;
/**
+ * Returns whether the read concern is speculative 'majority'.
+ */
+ bool isSpeculativeMajority() const;
+
+ /**
* Appends level and afterOpTime.
*/
void appendInfo(BSONObjBuilder* builder) const;