[SERVER-35699] Avoid holding locks during query parsing Created: 20/Jun/18  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Querying
Affects Version/s: 4.0.0-rc6
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-35693 Parsing of $in takes quadratic time d... Closed
is related to SERVER-29839 Protect against UUID->NSS mapping cha... Closed
is related to SERVER-32367 AutoGetCollectionOrView and its relat... Closed
is related to SERVER-30189 Reduce calls to allocator for large $... Closed
Assigned Teams:
Query Optimization
Backport Requested:
v4.0
Participants:
Case:

 Description   

Due to changes made in SERVER-29839 and SERVER-32367 during 3.7 development, we now acquire locks prior to query parsing in the find command path. This is a behavior change in 4.0 compared to previous stable versions, which did not hold locks while parsing the query.

Typically, parsing is fairly fast, but we have observed performance problems such as SERVER-35693 and SERVER-30189 in which parsing was time consuming. Therefore, there is some risk of this behavior change causing performance problems on MMAPv1, where a MODE_S lock is held instead of a MODE_IS intent shared lock. Even on WiredTiger, there is some risk of this causing a performance problem---if the parsing phase can run for seconds or minutes without yielding its intent locks, then it is possible for an operation that requires a strong lock to be blocked, which in turn will block subsequent queued readers and writers waiting for intent locks.



 Comments   
Comment by Ian Whalen (Inactive) [ 22/Jun/18 ]

Assigning to david.storch to figure out which team is best suited to makes these fixes.

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