diff options
author | Antonio Fuschetto <antonio.fuschetto@mongodb.com> | 2021-07-02 15:04:54 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-07-02 15:48:06 +0000 |
commit | 3dc03d637b4ea5d88130dc8ee3271fdf310cf92c (patch) | |
tree | 5a3679f1444989b3843174c92f516a87287e073f | |
parent | 736134ae7f00ea8046b43a5e4382289cda33393e (diff) | |
download | mongo-3dc03d637b4ea5d88130dc8ee3271fdf310cf92c.tar.gz |
SERVER-57064 Log create index and dropIndex(es) on mongos
-rw-r--r-- | src/mongo/s/commands/cluster_create_indexes_cmd.cpp | 9 | ||||
-rw-r--r-- | src/mongo/s/commands/cluster_drop_indexes_cmd.cpp | 4 |
2 files changed, 12 insertions, 1 deletions
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; } |