summaryrefslogtreecommitdiff
path: root/src/mongo/db/op_observer_impl.cpp
diff options
context:
space:
mode:
authorJudah Schvimer <judah@mongodb.com>2017-03-14 16:09:20 -0400
committerJudah Schvimer <judah@mongodb.com>2017-03-14 16:09:20 -0400
commit6fd95f8c1b97d72c411bc5a1c84b1d5a8efe4c07 (patch)
tree5f78d68e9aa798810d0f4e77f421039f8d7cd5b5 /src/mongo/db/op_observer_impl.cpp
parent56b5dbbd9901152a0a185c766679bb3c355ebedd (diff)
downloadmongo-6fd95f8c1b97d72c411bc5a1c84b1d5a8efe4c07.tar.gz
SERVER-28200 Extend dropIndexes oplog entry to include dropped index spec
Diffstat (limited to 'src/mongo/db/op_observer_impl.cpp')
-rw-r--r--src/mongo/db/op_observer_impl.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mongo/db/op_observer_impl.cpp b/src/mongo/db/op_observer_impl.cpp
index 63501a4af2e..ea0d64f6f09 100644
--- a/src/mongo/db/op_observer_impl.cpp
+++ b/src/mongo/db/op_observer_impl.cpp
@@ -255,12 +255,15 @@ void OpObserverImpl::onDropCollection(OperationContext* opCtx,
}
void OpObserverImpl::onDropIndex(OperationContext* opCtx,
- const std::string& dbName,
- const BSONObj& idxDescriptor) {
- repl::logOp(opCtx, "c", dbName.c_str(), idxDescriptor, nullptr, false);
-
- getGlobalAuthorizationManager()->logOp(opCtx, "c", dbName.c_str(), idxDescriptor, nullptr);
- logOpForDbHash(opCtx, dbName.c_str());
+ const NamespaceString& ns,
+ const std::string& indexName,
+ const BSONObj& indexInfo) {
+ BSONObj cmdObj = BSON("dropIndexes" << ns.coll() << "index" << indexName);
+ auto commandNS = ns.getCommandNS();
+ repl::logOp(opCtx, "c", commandNS.c_str(), cmdObj, &indexInfo, false);
+
+ getGlobalAuthorizationManager()->logOp(opCtx, "c", commandNS.c_str(), cmdObj, &indexInfo);
+ logOpForDbHash(opCtx, commandNS.c_str());
}
void OpObserverImpl::onRenameCollection(OperationContext* opCtx,