Implement $querySettings agg stage (SERVER-77468)

[SERVER-77790] Add support for showDebugQueryShape parameter in $querySettings Created: 05/Jun/23  Updated: 29/Oct/23  Resolved: 18/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Sub-task Priority: Major - P3
Reporter: Denis Grebennicov Assignee: Catalin Sumanaru
Resolution: Fixed Votes: 0
Labels: M1, auto-reverted
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-78698 Exclude the tenantId from the $queryS... Closed
Problem/Incident
Related
is related to SERVER-82128 Add deferred queue behaviour to $queu... Closed
is related to SERVER-81486 Extract CmdWithLetShape::makeDummyExp... Closed
Backwards Compatibility: Fully Compatible
Sprint: QE 2023-06-12, QE 2023-06-26, QE 2023-07-10, QE 2023-07-24, QE 2023-08-07, QE 2023-08-21, QE 2023-09-04, QE 2023-09-18, QE 2023-10-02, QE 2023-10-16, QE 2023-10-30, QE 2023-11-13, QE 2023-11-27
Participants:
Linked BF Score: 0

 Description   

As part of this ticket we need to implement a new $_internalDebugQueryShape aggregation expression and integrate it into $querySettings agg stage.

This expression will take the incoming BSONObj of the command and will call the corresponding function query_shape::extractQueryShape(). Similar method call is performed in setQuerySettings and removeQuerySettings commands in order to extract QueryShape from the given BSONObj command.

For inspiration on how to implement an aggregation expression, one could look at SERVER-68686

 

Instead of introducing a new agg expression, we could compute the QueryShape directly in DocumentSourceQuerySettings::createFromBson() where we populate the queue with the Documents, where we add additional attribute to each of the documents.

This approach should be much simpler, involves less code changes and is more performant.

 

However, neither of the approaches are easy due to the cyclic dependency between QueryShape module and Aggregate command. Curious if SERVER-79736 solves this problem



 Comments   
Comment by Githook User [ 18/Oct/23 ]

Author:

{'name': 'csum112', 'email': 'catalin.sumanaru@mongodb.com', 'username': ''}

Message: SERVER-77790 Add support for showDebugQueryShape parameter in $querySettings
Branch: master
https://github.com/mongodb/mongo/commit/8ba7843f1eda0a20e5416ccb5aee86ec83bb69ad

Comment by Githook User [ 14/Oct/23 ]

Author:

{'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com', 'username': ''}

Message: Revert "SERVER-77790 Add support for showDebugQueryShape parameter in $querySettings"

This reverts commit ff430ce9d2e6fbae41d5a80d95810547529f9dc8.
Branch: master
https://github.com/mongodb/mongo/commit/17171f3aa04b37b11c277ce8cc597759e5077744

Comment by Githook User [ 13/Oct/23 ]

Author:

{'name': 'csum112', 'email': 'catalin.sumanaru@mongodb.com', 'username': ''}

Message: SERVER-77790 Add support for showDebugQueryShape parameter in $querySettings
Branch: master
https://github.com/mongodb/mongo/commit/ff430ce9d2e6fbae41d5a80d95810547529f9dc8

Generated at Thu Feb 08 06:36:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.