From 265ba00b96161463bc2a6d8640098d3ac4e4b70a Mon Sep 17 00:00:00 2001 From: Irina Yatsenko Date: Thu, 29 Apr 2021 23:42:13 +0000 Subject: SERVER-50286 Indicate in logs whether an operation involves a view --- src/mongo/db/curop.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/mongo/db/curop.h') diff --git a/src/mongo/db/curop.h b/src/mongo/db/curop.h index 44530fcfbfd..aab0d9fad30 100644 --- a/src/mongo/db/curop.h +++ b/src/mongo/db/curop.h @@ -201,6 +201,18 @@ public: */ BSONObj makeMongotDebugStatsObject() const; + /** + * Accumulate resolved views. + */ + void addResolvedViews(const std::vector& namespaces, + const std::vector& pipeline); + + /** + * Get or append the array with resolved views' info. + */ + BSONArray getResolvedViewsInfo() const; + void appendResolvedViewsInfo(BSONObjBuilder& builder) const; + // ------------------- // basic options @@ -279,6 +291,12 @@ public: // Whether this is an oplog getMore operation for replication oplog fetching. bool isReplOplogGetMore{false}; + + // Maps namespace of a resolved view to its dependency chain and the fully unrolled pipeline. To + // make log line deterministic and easier to test, use ordered map. As we don't expect many + // resolved views per query, a hash map would unlikely provide any benefits. + std::map, std::vector>> + resolvedViews; }; /** -- cgit v1.2.1