summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/repl_client_info.cpp
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2015-07-27 09:42:24 -0400
committerEric Milkie <milkie@10gen.com>2015-07-29 15:24:25 -0400
commit9ab26585bd47f189c9c6359ad295e3d6e7a03c0c (patch)
treeefd358550c334fef33d4186682beb1f3a267e83e /src/mongo/db/repl/repl_client_info.cpp
parentc61587605ae1077526490e2992d55e08401b2a98 (diff)
downloadmongo-9ab26585bd47f189c9c6359ad295e3d6e7a03c0c.tar.gz
SERVER-18522 set lastOp to last system optime, on no-op updates or deletes
Diffstat (limited to 'src/mongo/db/repl/repl_client_info.cpp')
-rw-r--r--src/mongo/db/repl/repl_client_info.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/repl/repl_client_info.cpp b/src/mongo/db/repl/repl_client_info.cpp
index 18191bfaffc..e4c6ddbdbed 100644
--- a/src/mongo/db/repl/repl_client_info.cpp
+++ b/src/mongo/db/repl/repl_client_info.cpp
@@ -33,6 +33,7 @@
#include "mongo/base/init.h"
#include "mongo/db/client.h"
#include "mongo/db/jsobj.h"
+#include "mongo/db/operation_context.h"
#include "mongo/db/repl/replication_coordinator_global.h"
#include "mongo/util/decorable.h"
@@ -49,5 +50,12 @@ long long ReplClientInfo::getTerm() {
return _cachedTerm;
}
+void ReplClientInfo::setLastOpToSystemLastOpTime(OperationContext* txn) {
+ ReplicationCoordinator* replCoord = repl::ReplicationCoordinator::get(txn->getServiceContext());
+ if (replCoord->isReplEnabled()) {
+ setLastOp(replCoord->getMyLastOptime());
+ }
+}
+
} // namespace repl
} // namespace mongo