[SERVER-39394] Views collation check should traverse through nested $lookup pipelines Created: 06/Feb/19  Updated: 29/Oct/23  Resolved: 07/Feb/19

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: 3.6.0, 4.0.0
Fix Version/s: 3.6.12, 4.0.7, 4.1.8

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

Issue Links:
Backports
Depends
is depended on by SERVER-38360 Disallow pipelines which read from th... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0, v3.6
Sprint: Query 2019-02-11
Participants:

 Description   

It looks like $lookup's implementation of addInvolvedCollections is incorrect. It neglects to include any namespaces that are referenced in a subpipline, should one exist.

It looks like this method is only used to check that all involved views are using the same collation, so the impact of this bad implementation would be a failure to detect mixed collations within a $lookup subpipeline.



 Comments   
Comment by Githook User [ 01/Mar/19 ]

Author:

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

Message: SERVER-39394 Traverse $lookup subpipeline for more involved collections

(cherry picked from commit 346b2980a2122f984bfa4c359468f547776caae6)
(cherry picked from commit fbd1f7e6bbb9da5c1efb3e34cb66ef07dd93290c)
Branch: v3.6
https://github.com/mongodb/mongo/commit/94b2ddce2e3a43ea94e99394336c8bd77bcefbe5

Comment by Githook User [ 20/Feb/19 ]

Author:

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

Message: SERVER-39394 Traverse $lookup subpipeline for more involved collections

(cherry picked from commit 346b2980a2122f984bfa4c359468f547776caae6)
Branch: v4.0
https://github.com/mongodb/mongo/commit/fbd1f7e6bbb9da5c1efb3e34cb66ef07dd93290c

Comment by Charlie Swanson [ 07/Feb/19 ]

Nevermind, I was mistaken.

Comment by Charlie Swanson [ 07/Feb/19 ]

Re-opening because I found another subtle problem to address. Another patch coming soon.

Comment by Githook User [ 06/Feb/19 ]

Author:

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

Message: SERVER-39394 Traverse $lookup subpipeline for more involved collections
Branch: master
https://github.com/mongodb/mongo/commit/346b2980a2122f984bfa4c359468f547776caae6

Comment by Charlie Swanson [ 06/Feb/19 ]

This is depended on by SERVER-38360 since we plan to use this 'getInvolvedCollections' method to check whether an $out is writing to any of those namespaces.

Generated at Thu Feb 08 04:51:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.