diff options
author | Lingzhi Deng <lingzhi.deng@mongodb.com> | 2020-04-28 21:20:45 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-29 23:05:43 +0000 |
commit | f674117136f9b2699ab42a32f6f08f6c0b5a84b3 (patch) | |
tree | 35bb9b210eafa2aff85568cd245100b3a8d4e245 /src/mongo/db/repl/read_concern_args.h | |
parent | f950ce6ca8e360becb502a09b7f371b2f2c807da (diff) | |
download | mongo-f674117136f9b2699ab42a32f6f08f6c0b5a84b3.tar.gz |
SERVER-47577: readConcernCounters metric in serverStatus
Diffstat (limited to 'src/mongo/db/repl/read_concern_args.h')
-rw-r--r-- | src/mongo/db/repl/read_concern_args.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/repl/read_concern_args.h b/src/mongo/db/repl/read_concern_args.h index 04a2c3e131a..bdc3c5bf4eb 100644 --- a/src/mongo/db/repl/read_concern_args.h +++ b/src/mongo/db/repl/read_concern_args.h @@ -185,8 +185,18 @@ public: void setArgsAtClusterTimeForSnapshot(Timestamp ts) { invariant(_level && _level == ReadConcernLevel::kSnapshotReadConcern); invariant(!_atClusterTime); + invariant(!_atClusterTimeSelected); _afterClusterTime = boost::none; _atClusterTime = LogicalTime(ts); + _atClusterTimeSelected = true; + } + + /** + * Return whether an atClusterTime has been selected by the server for a snapshot read. This + * function returns false if the atClusterTime was specified by the client. + */ + bool wasAtClusterTimeSelected() const { + return _atClusterTimeSelected; } private: @@ -223,6 +233,8 @@ private: bool _specified; ReadWriteConcernProvenance _provenance; + + bool _atClusterTimeSelected = false; }; } // namespace repl |