diff options
author | Geert Bosch <geert@mongodb.com> | 2017-04-18 17:08:10 -0400 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2017-04-21 14:00:16 -0400 |
commit | 99531b4db7b7bda1ac2558db1786905d36c82d29 (patch) | |
tree | df59224d87ec2fb4c12c142e24870dfae321c49b /src/mongo/db/op_observer.h | |
parent | ab0fc1ebb4df846367d409e0223a085e0db1b98e (diff) | |
download | mongo-99531b4db7b7bda1ac2558db1786905d36c82d29.tar.gz |
SERVER-27989 Implement new oplog format with collection UUIDs
Diffstat (limited to 'src/mongo/db/op_observer.h')
-rw-r--r-- | src/mongo/db/op_observer.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/mongo/db/op_observer.h b/src/mongo/db/op_observer.h index 2cdc981bb74..23cd5cce4a6 100644 --- a/src/mongo/db/op_observer.h +++ b/src/mongo/db/op_observer.h @@ -31,6 +31,7 @@ #include <string> #include "mongo/base/disallow_copying.h" +#include "mongo/db/catalog/collection_options.h" #include "mongo/db/jsobj.h" #include "mongo/db/s/collection_sharding_state.h" @@ -46,6 +47,8 @@ struct OplogUpdateEntryArgs { // Name of the collection in which document is being updated. NamespaceString nss; + OptionalCollectionUUID uuid; + // Fully updated document with damages (update modifiers) applied. BSONObj updatedDoc; @@ -67,17 +70,19 @@ public: virtual ~OpObserver() = default; virtual void onCreateIndex(OperationContext* opCtx, - const NamespaceString& ns, + const NamespaceString& nss, + OptionalCollectionUUID uuid, BSONObj indexDoc, bool fromMigrate) = 0; virtual void onInserts(OperationContext* opCtx, - const NamespaceString& ns, + const NamespaceString& nss, + OptionalCollectionUUID uuid, std::vector<BSONObj>::const_iterator begin, std::vector<BSONObj>::const_iterator end, bool fromMigrate) = 0; virtual void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) = 0; virtual CollectionShardingState::DeleteState aboutToDelete(OperationContext* opCtx, - const NamespaceString& ns, + const NamespaceString& nss, const BSONObj& doc) = 0; /** * Handles logging before document is deleted. @@ -89,7 +94,8 @@ public: * real delete. */ virtual void onDelete(OperationContext* opCtx, - const NamespaceString& ns, + const NamespaceString& nss, + OptionalCollectionUUID uuid, CollectionShardingState::DeleteState deleteState, bool fromMigrate) = 0; virtual void onOpMessage(OperationContext* opCtx, const BSONObj& msgObj) = 0; @@ -99,10 +105,12 @@ public: const BSONObj& idIndex) = 0; virtual void onCollMod(OperationContext* opCtx, const NamespaceString& nss, + OptionalCollectionUUID uuid, const BSONObj& collModCmd) = 0; virtual void onDropDatabase(OperationContext* opCtx, const std::string& dbName) = 0; virtual void onDropCollection(OperationContext* opCtx, - const NamespaceString& collectionName) = 0; + const NamespaceString& collectionName, + OptionalCollectionUUID uuid) = 0; /** * This function logs an oplog entry when an index is dropped. The namespace of the index, * the index name, and the index info from the index descriptor are used to create a @@ -113,20 +121,27 @@ public: * oplog entry. This means it's possible to roll back half of the index drops. */ virtual void onDropIndex(OperationContext* opCtx, - const NamespaceString& ns, + const NamespaceString& nss, + OptionalCollectionUUID uuid, const std::string& indexName, const BSONObj& indexInfo) = 0; virtual void onRenameCollection(OperationContext* opCtx, const NamespaceString& fromCollection, const NamespaceString& toCollection, + OptionalCollectionUUID uuid, bool dropTarget, + OptionalCollectionUUID dropTargetUUID, + OptionalCollectionUUID dropSourceUUID, bool stayTemp) = 0; virtual void onApplyOps(OperationContext* opCtx, const std::string& dbName, const BSONObj& applyOpCmd) = 0; - virtual void onEmptyCapped(OperationContext* opCtx, const NamespaceString& collectionName) = 0; + virtual void onEmptyCapped(OperationContext* opCtx, + const NamespaceString& collectionName, + OptionalCollectionUUID uuid) = 0; virtual void onConvertToCapped(OperationContext* opCtx, const NamespaceString& collectionName, + OptionalCollectionUUID uuid, double size) = 0; }; |