summaryrefslogtreecommitdiff
path: root/src/mongo/db/curop.h
diff options
context:
space:
mode:
authorIrina Yatsenko <irina.yatsenko@mongodb.com>2021-04-29 23:42:13 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-12 18:36:03 +0000
commit265ba00b96161463bc2a6d8640098d3ac4e4b70a (patch)
tree819a268613c34917b85c8b1ac530c2d05934039b /src/mongo/db/curop.h
parent1c7969556696ff8bce4b213c3d85598d0961cd2b (diff)
downloadmongo-265ba00b96161463bc2a6d8640098d3ac4e4b70a.tar.gz
SERVER-50286 Indicate in logs whether an operation involves a view
Diffstat (limited to 'src/mongo/db/curop.h')
-rw-r--r--src/mongo/db/curop.h18
1 files changed, 18 insertions, 0 deletions
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<NamespaceString>& namespaces,
+ const std::vector<BSONObj>& 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<NamespaceString, std::pair<std::vector<NamespaceString>, std::vector<BSONObj>>>
+ resolvedViews;
};
/**