summaryrefslogtreecommitdiff
path: root/src/mongo/db/op_observer_impl.cpp
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2017-05-23 23:58:49 -0400
committerBenety Goh <benety@mongodb.com>2017-05-24 14:19:39 -0400
commit3db02ac2a719687829b3fd6a71927d263bdbd667 (patch)
tree950837ef67503c5d821e6c876510e0e19ac2e83d /src/mongo/db/op_observer_impl.cpp
parent3a4084e613847f96e3f3817e4b8caa02c342a2fe (diff)
downloadmongo-3db02ac2a719687829b3fd6a71927d263bdbd667.tar.gz
SERVER-29274 OpObserver::onDropCollection() returns drop optime
Diffstat (limited to 'src/mongo/db/op_observer_impl.cpp')
-rw-r--r--src/mongo/db/op_observer_impl.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mongo/db/op_observer_impl.cpp b/src/mongo/db/op_observer_impl.cpp
index a36a41c8b43..3e306a4c3eb 100644
--- a/src/mongo/db/op_observer_impl.cpp
+++ b/src/mongo/db/op_observer_impl.cpp
@@ -295,15 +295,16 @@ void OpObserverImpl::onDropDatabase(OperationContext* opCtx, const std::string&
getGlobalAuthorizationManager()->logOp(opCtx, "c", cmdNss, cmdObj, nullptr);
}
-void OpObserverImpl::onDropCollection(OperationContext* opCtx,
- const NamespaceString& collectionName,
- OptionalCollectionUUID uuid) {
+repl::OpTime OpObserverImpl::onDropCollection(OperationContext* opCtx,
+ const NamespaceString& collectionName,
+ OptionalCollectionUUID uuid) {
const NamespaceString dbName = collectionName.getCommandNS();
BSONObj cmdObj = BSON("drop" << collectionName.coll().toString());
+ repl::OpTime dropOpTime;
if (!collectionName.isSystemDotProfile()) {
// do not replicate system.profile modifications
- repl::logOp(opCtx, "c", dbName, uuid, cmdObj, nullptr, false);
+ dropOpTime = repl::logOp(opCtx, "c", dbName, uuid, cmdObj, nullptr, false);
}
if (collectionName.coll() == DurableViewCatalog::viewsCollectionName()) {
@@ -328,6 +329,8 @@ void OpObserverImpl::onDropCollection(OperationContext* opCtx,
UUIDCatalog& catalog = UUIDCatalog::get(opCtx->getServiceContext());
catalog.onDropCollection(opCtx, uuid.get());
}
+
+ return dropOpTime;
}
void OpObserverImpl::onDropIndex(OperationContext* opCtx,