[SERVER-66418] Bad projection created during dependency analysis due to string order assumption Created: 11/May/22  Updated: 29/Oct/23  Resolved: 17/Jun/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.0.7, 6.0.0-rc6, 6.1.0-rc0
Fix Version/s: 5.0.10, 4.4.16, 4.2.22, 6.0.0-rc11, 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Matt Boros Assignee: Steve Tarzia
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-67264 Avoid COLUMN_SCAN if dependencies pre... Closed
Related
related to SERVER-67416 Always sort fieldpath string sets usi... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0, v5.0, v4.4, v4.2
Sprint: QO 2022-06-13, QE 2022-06-27
Participants:

 Description   

If there’s not a projection at the front of a pipeline during planning, we'll try to create one to push down by doing dependency analysis on the pipeline, then constructing a projection from the results. The logic for converting the dependency analysis results to a projection spec relies on set iterators going in lexicographic order so that a string is always directly before all of the fields it prefixes.

That is true in some cases. If the pipeline has dependencies on “a.b” and “a.b.c”, then we process the strings in that order and we create a projection indicating that “a.b” should be included.

However, if the pipeline has dependencies on “a.b”, “a.b.c”, and “a.b-d”, then the order we process the fields in is “a.b”, “a.b-d”, “a.b.c”. As a result, we try to create a projection indicating that all three fields should be included. This fails with a path collision error.



 Comments   
Comment by Githook User [ 24/Jun/22 ]

Author:

{'name': 'Steve Tarzia', 'email': 'steve.tarzia@mongodb.com', 'username': 'starzia'}

Message: SERVER-66418 fix bug in projection created during dependency analysis
Branch: v4.2
https://github.com/mongodb/mongo/commit/20ee02b3ba6a0d8a120eb4fdc947c92d71fd66bd

Comment by Githook User [ 23/Jun/22 ]

Author:

{'name': 'Steve Tarzia', 'email': 'steve.tarzia@mongodb.com', 'username': 'starzia'}

Message: SERVER-66418 fix bug in projection created during dependency analysis
Branch: v5.0
https://github.com/mongodb/mongo/commit/09546e0661b4730bd78bb64b330fd8f3ef155c25

Comment by Githook User [ 23/Jun/22 ]

Author:

{'name': 'Steve Tarzia', 'email': 'steve.tarzia@mongodb.com', 'username': 'starzia'}

Message: SERVER-66418 fix bug in projection created during dependency analysis
Branch: v4.4
https://github.com/mongodb/mongo/commit/bd7423724f1cd2983ffa177e2ba538859ae4ff63

Comment by Githook User [ 17/Jun/22 ]

Author:

{'name': 'Steve Tarzia', 'email': 'steve.tarzia@mongodb.com', 'username': 'starzia'}

Message: SERVER-66418 fix bug in projection created during dependency analysis
Branch: v6.0
https://github.com/mongodb/mongo/commit/b7eb1cd26e0b63400d8a34c63a5fcfa7f1c2890e

Comment by Githook User [ 17/Jun/22 ]

Author:

{'name': 'Steve Tarzia', 'email': 'steve.tarzia@mongodb.com', 'username': 'starzia'}

Message: SERVER-66418 fix bug in projection created during dependency analysis
Branch: master
https://github.com/mongodb/mongo/commit/040ac37b03e9325cdc1de6dbae76172e0bb4a63a

Comment by Ana Meza [ 19/May/22 ]

james.wahlin@mongodb.com jacob.evans@mongodb.com would someone on your team have capacity to work on this one?

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