[SERVER-44828] Correct logic to re-compute dependencies after absorbing a $sort into query layer Created: 25/Nov/19  Updated: 29/Oct/23  Resolved: 09/Dec/19

Status: Closed
Project: Core Server
Component/s: Aggregation Framework, Performance, Querying
Affects Version/s: None
Fix Version/s: 3.6.17, 4.2.3, 4.0.15

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Charlie Swanson
Resolution: Fixed Votes: 0
Labels: qopt-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0, v3.6
Sprint: Query 2019-12-02, Query 2019-12-16
Participants:
Case:

 Description   

SERVER-39109 inadvertently thwarted an optimization to re-compute the set of fields needed for the aggregation. Instead of re-computing the dependencies in such a scenario, it will get confused because the $cursor stage has already been added and mistakenly report that all fields are needed for the aggregation. We should restore the optimization.



 Comments   
Comment by Githook User [ 19/Dec/19 ]

Author:

{'name': 'Charlie Swanson', 'email': 'charlie.swanson@mongodb.com', 'username': 'cswanson310'}

Message: SERVER-44828 Correct logic to re-compute dependencies

We do this after absorbing a $sort into query layer, but this
optimization was accidentally thwarted by a recent bug fix. This patch
restores this optimization.

(cherry picked from commit 68d9027d26d469ab003bf81be95df6395d4dad19)
Branch: v4.0
https://github.com/mongodb/mongo/commit/17c49aae7be6a855322e6488fe605e17698fdd43

Comment by Githook User [ 19/Dec/19 ]

Author:

{'name': 'Charlie Swanson', 'email': 'charlie.swanson@mongodb.com', 'username': 'cswanson310'}

Message: SERVER-44828 Correct logic to re-compute dependencies

We do this after absorbing a $sort into query layer, but this
optimization was accidentally thwarted by a recent bug fix. This patch
restores this optimization.

(cherry picked from commit 68d9027d26d469ab003bf81be95df6395d4dad19)
(cherry picked from commit 8170a1a318e3c12f31fcfd6094b970b0e27b9211)
Branch: v3.6
https://github.com/mongodb/mongo/commit/62c9e0b7393e6c636724ab3abc5ab400583cb668

Comment by Githook User [ 09/Dec/19 ]

Author:

{'email': 'charlie.swanson@mongodb.com', 'name': 'Charlie Swanson', 'username': 'cswanson310'}

Message: SERVER-44828 Correct logic to re-compute dependencies

We do this after absorbing a $sort into query layer, but this
optimization was accidentally thwarted by a recent bug fix. This patch
restores this optimization.
Branch: v4.2
https://github.com/mongodb/mongo/commit/68d9027d26d469ab003bf81be95df6395d4dad19

Comment by Githook User [ 03/Dec/19 ]

Author:

{'email': 'charlie.swanson@mongodb.com', 'name': 'Charlie Swanson', 'username': 'cswanson310'}

Message: PERF-1938 Performance workloads for SERVER-44828
Branch: master
https://github.com/mongodb/mongo-perf/commit/d8108e29c1b2e3c5ac97eb65b71990be6dcd24af

Comment by Charlie Swanson [ 25/Nov/19 ]

This fix will be authored for the 4.2 branch. The code in question has diverged sufficiently in master that this no longer appears to be a problem. I'm requesting backport to the 4.0 and 3.6 branches.

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