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

Allow operations in transactions to safely consult the CatalogCache on mongod

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.4
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Sharding 2019-12-30, Sharding 2020-01-13, Sharding 2020-01-27, Sharding 2020-02-10, Sharding 2020-02-24
    • Linked BF Score:
      0

      Description

      When brainstorming the design for $unionWith, we are concerned about an issue we have previously run into in such a scenario. Esha Maharishi sums up a possible deadlock that can occur when a shard tries to look at the CatalogCache while still holding a lock in this comment. It's also described in SERVER-37398 where we added this invariant to ensure this never happens. This was discovered when working with improved $out (now branded as $merge), but it has implications for sharded $lookup and now $unionWith.

      This ticket tracks a feature request to remove that invariant. It should be possible to query a different shard using the CatalogCache while you are in a transaction (and thus hold some locks which you cannot drop). Currently you cannot do this because it may deadlock.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tommaso.tocci Tommaso Tocci
              Reporter:
              charlie.swanson Charlie Swanson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: