[SERVER-47162] aggregate() namespace resolution and collMod are not synchronized (anymore) Created: 27/Mar/20  Updated: 27/Oct/23  Resolved: 01/Apr/20

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Ian Boros Assignee: Gregory Noma
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-46865 collMod should not take database MODE... Closed
Operating System: ALL
Sprint: Execution Team 2020-04-06
Participants:
Linked BF Score: 24

 Description   

Since we no longer take a DB MODE_X lock for collMod (see SERVER-46865), the code for resolving namespaces in aggregate(), which takes a DB MODE_IS lock, does not necessarily see a consistent "view" of the view catalog. See link.

This means that aggregate() can execute a pipeline on a set of view definitions that are not valid/nonsensical and possibly even contain a cycle.

One potential fix would be to have the view resolution in run_aggregate be performed while holding a collection IS lock on system.views. I believe this will fix the issue as long as collMod continues taking a collection X lock (see here).



 Comments   
Comment by Gregory Noma [ 01/Apr/20 ]

This will be fixed as a part of an updated version of SERVER-46865, so closing as Gone Away.

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