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

Aggregation can run lock-free and expects a ViewCatalog access separate from the AutoGet*MaybeLockFree to always return a valid ViewCatalog -- not guaranteed

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Execution Team 2021-12-27, Execution Team 2022-01-10
    • 145

      This code does DatabaseHolder::getViewCatalog()->resolveView without checking that getViewCatalog doesn't return a nullptr. It makes this assumption because the code is gated by an autoGet->getView check.

      Two solution here.

      1) Aggregation can error when it finds the ViewCatalog no longer exists. (I rather like the simplicity). This means the collection didn't exist when the command started, and then the view went away somehow during the command. Aggregate is just about to drop locks anyway, which means anything can happen after view resolution

      2) Lock-free operations must support ViewCatalog::resolveView with the same ViewCatalog used to fetch the view – likely save the ViewCatalog shared_ptr on the AutoGet*LockFree, if we find a view.

       

            Assignee:
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Reporter:
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: