From 3dc03d637b4ea5d88130dc8ee3271fdf310cf92c Mon Sep 17 00:00:00 2001 From: Antonio Fuschetto Date: Fri, 2 Jul 2021 15:04:54 +0000 Subject: SERVER-57064 Log create index and dropIndex(es) on mongos --- src/mongo/s/commands/cluster_create_indexes_cmd.cpp | 9 ++++++++- src/mongo/s/commands/cluster_drop_indexes_cmd.cpp | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mongo/s/commands/cluster_create_indexes_cmd.cpp b/src/mongo/s/commands/cluster_create_indexes_cmd.cpp index 03fd5c28775..a7999507bbd 100644 --- a/src/mongo/s/commands/cluster_create_indexes_cmd.cpp +++ b/src/mongo/s/commands/cluster_create_indexes_cmd.cpp @@ -93,7 +93,14 @@ public: BSONObj() /* query */, BSONObj() /* collation */); - return appendRawResponses(opCtx, &errmsg, &output, std::move(shardResponses)).responseOK; + const bool ok = + appendRawResponses(opCtx, &errmsg, &output, std::move(shardResponses)).responseOK; + + if (ok) { + LOGV2(5706400, "Indexes created", "namespace"_attr = nss); + } + + return ok; } } createIndexesCmd; diff --git a/src/mongo/s/commands/cluster_drop_indexes_cmd.cpp b/src/mongo/s/commands/cluster_drop_indexes_cmd.cpp index b26d3703db9..e0cb7c601ec 100644 --- a/src/mongo/s/commands/cluster_drop_indexes_cmd.cpp +++ b/src/mongo/s/commands/cluster_drop_indexes_cmd.cpp @@ -146,6 +146,10 @@ public: uassertStatusOK(*aggregateResponse.firstStaleConfigError); } + if (aggregateResponse.responseOK) { + LOGV2(5706401, "Indexes dropped", "namespace"_attr = nss); + } + return aggregateResponse.responseOK; } -- cgit v1.2.1