Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-35699

Avoid holding locks during query parsing

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.0.0-rc6
    • Component/s: Querying
    • None
    • Query Optimization
    • v4.0

      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.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated: