From 3db02ac2a719687829b3fd6a71927d263bdbd667 Mon Sep 17 00:00:00 2001 From: Benety Goh Date: Tue, 23 May 2017 23:58:49 -0400 Subject: SERVER-29274 OpObserver::onDropCollection() returns drop optime --- src/mongo/db/op_observer.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/mongo/db/op_observer.h') 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 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 -- cgit v1.2.1