diff options
author | Benety Goh <benety@mongodb.com> | 2017-05-23 23:58:49 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2017-05-24 14:19:39 -0400 |
commit | 3db02ac2a719687829b3fd6a71927d263bdbd667 (patch) | |
tree | 950837ef67503c5d821e6c876510e0e19ac2e83d /src/mongo/db/op_observer.h | |
parent | 3a4084e613847f96e3f3817e4b8caa02c342a2fe (diff) | |
download | mongo-3db02ac2a719687829b3fd6a71927d263bdbd667.tar.gz |
SERVER-29274 OpObserver::onDropCollection() returns drop optime
Diffstat (limited to 'src/mongo/db/op_observer.h')
-rw-r--r-- | src/mongo/db/op_observer.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mongo/db/op_observer.h b/src/mongo/db/op_observer.h index 33d2a76ba16..00dc3ec324b 100644 --- a/src/mongo/db/op_observer.h +++ b/src/mongo/db/op_observer.h @@ -40,6 +40,10 @@ struct CollectionOptions; class NamespaceString; class OperationContext; +namespace repl { +class OpTime; +} // repl + /** * Holds document update information used in logging. */ @@ -148,9 +152,16 @@ public: const CollectionOptions& oldCollOptions, boost::optional<TTLCollModInfo> ttlInfo) = 0; virtual void onDropDatabase(OperationContext* opCtx, const std::string& dbName) = 0; - virtual void onDropCollection(OperationContext* opCtx, - const NamespaceString& collectionName, - OptionalCollectionUUID uuid) = 0; + + /** + * This function logs an oplog entry when a 'drop' command on a collection is executed. + * Returns the optime of the oplog entry successfully written to the oplog. + * Returns a null optime if an oplog entry should not be written for this operation. + */ + virtual repl::OpTime onDropCollection(OperationContext* opCtx, + 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 |