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

Allow an aggregation sub-operation on a shard to target itself when running in a transaction

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • Fully Compatible

      Certain aggregation stages involve sub-operations or sub-pipelines, which may involve targetting and reading from sharded collections when running on a shard (e.g. $lookup, $unionWith). Supporting such stages in a transaction would cause a deadlock on the session mutex if the sub-operation targets the same node its running on, similar to what is described in SERVER-33683. Note that SERVER-33683 allows a $mergeCursors to run on a shard in a txn, but does not support the case when a stage starts its own sub-operation.

      For this ticket, one possible solution that was discussed would be to use the resource yielder that was built in SERVER-33683 within the MultiStatementTransactionRequestsSender if one of the remote shards involved happens to be itself.

            Assignee:
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Reporter:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: