summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/repl_client_info.h
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2017-02-14 17:59:57 -0500
committerSpencer T Brody <spencer@mongodb.com>2017-02-15 15:55:45 -0500
commit34c00f16a8890775c71c63c860e2086c6bb603aa (patch)
tree6de598f678ec4819cabb2c6a554f3dce834f7b03 /src/mongo/db/repl/repl_client_info.h
parent7d36244539cff23adb813f9cc006b1e9fe4305e0 (diff)
downloadmongo-34c00f16a8890775c71c63c860e2086c6bb603aa.tar.gz
SERVER-28013 Ensure that last op for client only moves forward
Diffstat (limited to 'src/mongo/db/repl/repl_client_info.h')
-rw-r--r--src/mongo/db/repl/repl_client_info.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mongo/db/repl/repl_client_info.h b/src/mongo/db/repl/repl_client_info.h
index 4c01119b794..3c81953d65f 100644
--- a/src/mongo/db/repl/repl_client_info.h
+++ b/src/mongo/db/repl/repl_client_info.h
@@ -45,13 +45,17 @@ class ReplClientInfo {
public:
static const Client::Decoration<ReplClientInfo> forClient;
- void setLastOp(const OpTime& op) {
- _lastOp = op;
- }
+ void setLastOp(const OpTime& op);
+
OpTime getLastOp() const {
return _lastOp;
}
+ // Resets the last op on this client; should only be used in testing.
+ void clearLastOp_forTest() {
+ _lastOp = OpTime();
+ }
+
void setLastSnapshot(SnapshotName name) {
_lastSnapshot = name;
}