diff options
author | Randolph Tan <randolph@10gen.com> | 2017-07-27 10:32:09 -0400 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2017-08-17 16:58:40 -0400 |
commit | 1e11cda15ddae9972f9993a7d6b6cbf9d172bcb3 (patch) | |
tree | 07546cb1464f52398f92db85e8af063d9f3112e0 /src/mongo/db/repl/oplog.h | |
parent | d7325950d72c6aacd25ecbd65888c050fe63482c (diff) | |
download | mongo-1e11cda15ddae9972f9993a7d6b6cbf9d172bcb3.tar.gz |
SERVER-30407 Store pre/post-image documents when running findAndModify with txnNumber
Diffstat (limited to 'src/mongo/db/repl/oplog.h')
-rw-r--r-- | src/mongo/db/repl/oplog.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mongo/db/repl/oplog.h b/src/mongo/db/repl/oplog.h index f119534ad7a..241b5ca746a 100644 --- a/src/mongo/db/repl/oplog.h +++ b/src/mongo/db/repl/oplog.h @@ -49,6 +49,15 @@ class OperationContext; namespace repl { class ReplSettings; +struct PreAndPostImageTimestamps { + PreAndPostImageTimestamps() = default; + PreAndPostImageTimestamps(Timestamp _preImageTs, Timestamp _postImageTs) + : preImageTs(std::move(_preImageTs)), postImageTs(std::move(_postImageTs)) {} + + Timestamp preImageTs; + Timestamp postImageTs; +}; + /** * Create a new capped collection for the oplog if it doesn't yet exist. * If the collection already exists (and isReplSet is false), @@ -88,6 +97,10 @@ OpTime logInsertOps(OperationContext* opCtx, * * For 'u' records, 'obj' captures the mutation made to the object but not * the object itself. 'o2' captures the the criteria for the object that will be modified. + * + * preAndPostImageTs this contains the timestamp of the oplog entry that contains the document + * before/after update was applied. The timestamps are ignored if isNull() is true. + * * Returns the optime of the oplog entry written to the oplog. * Returns a null optime if oplog was not modified. */ @@ -98,7 +111,8 @@ OpTime logOp(OperationContext* opCtx, const BSONObj& obj, const BSONObj* o2, bool fromMigrate, - StmtId stmtId); + StmtId stmtId, + const PreAndPostImageTimestamps& preAndPostTs); // Flush out the cached pointers to the local database and oplog. // Used by the closeDatabase command to ensure we don't cache closed things. |