diff options
author | Eric Milkie <milkie@10gen.com> | 2017-04-06 15:30:59 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2017-08-22 13:45:12 -0400 |
commit | 77dc6917428ffad4b9ff2d54d78fa9b225f78a4b (patch) | |
tree | fa2483cb4214fd6858db09ca80523751f65888f5 /src/mongo/db/repl/storage_interface.h | |
parent | b1a36aaa34f48df1573d76439419552282f18cbf (diff) | |
download | mongo-77dc6917428ffad4b9ff2d54d78fa9b225f78a4b.tar.gz |
SERVER-28620 Adorn all oplog writes with timestamps
These timestamps are now used to implement oplog visibility rules, in place of the current
in-memory vector of uncommitted ops that the WiredTiger glue code currently uses.
This change also introduces a TimestampedBSONObj class, which encapsulates a BSONObject with its
associated write timestamp.
Diffstat (limited to 'src/mongo/db/repl/storage_interface.h')
-rw-r--r-- | src/mongo/db/repl/storage_interface.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mongo/db/repl/storage_interface.h b/src/mongo/db/repl/storage_interface.h index 764bdcadad3..27507e790e8 100644 --- a/src/mongo/db/repl/storage_interface.h +++ b/src/mongo/db/repl/storage_interface.h @@ -42,6 +42,7 @@ #include "mongo/db/repl/collection_bulk_loader.h" #include "mongo/db/repl/optime.h" #include "mongo/db/service_context.h" +#include "mongo/db/storage/snapshot_name.h" namespace mongo { @@ -51,6 +52,11 @@ class OperationContext; namespace repl { +struct TimestampedBSONObj { + BSONObj obj; + SnapshotName timestamp; +}; + /** * Storage interface used by the replication system to interact with storage. * This interface provides seperation of concerns and a place for mocking out test @@ -98,17 +104,18 @@ public: const std::vector<BSONObj>& secondaryIndexSpecs) = 0; /** - * Inserts a document into a collection. + * Inserts a document with a timestamp into a collection. * * NOTE: If the collection doesn't exist, it will not be created, and instead * an error is returned. */ virtual Status insertDocument(OperationContext* opCtx, const NamespaceString& nss, - const BSONObj& doc) = 0; + const TimestampedBSONObj& doc) = 0; /** - * Inserts the given documents into the collection. + * Inserts the given documents, with associated timestamps and statement id's, into the + * collection. * It is an error to call this function with an empty set of documents. */ virtual Status insertDocuments(OperationContext* opCtx, |