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

Refactor CollectionBulkLoaderImpl to not hold locks as members

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • Execution Team 2022-10-03

      As part of SERVER-57432 we discovered that the class itself is using the locks in an unconventional fashion that can lead to confusion by thinking it holds a lock in MODE_IX while actually having a MODE_X lock. What's more, the underlying code requires the lock to be MODE_X.

      The confusion stems from the fact it treats locks as movable entities when they are meant to only be used within scopes, releasing themselves when they leave it. The class instead obtains a lock during construction and releases it only when it goes out of scope, even though it gets called during different times for the various stages.

      As a result we should cleanup the method so that it acquires the lock in each method instead of assuming a lock during the entire lifetime of the object.

            Assignee:
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Reporter:
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: