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

Migration Destination Manager should not check out a session with a mixed opCtx and Client

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v7.0, v6.0, v5.0
    • CAR Team 2024-03-18, CAR Team 2024-04-01
    • 149

      In the migration destination manager, AlternativeClientRegions are used to do writes that don't need to be done under the main op context's session. However, when certain operations are done (specifically those that will wait for write concern), the session from the original operation context still needs to be yielded and so runWithoutSession is called with the original operation context to yield the session, run the command, and reacquire the session.

      Reacquiring the session can involve doing a read via dbDirectClient if the session is not found in memory. This will cause an invariant with the sequence of events in the migration destination manager since the opCtx is the original one but the client is from the alternative client region.

      This can be fixed by switching back to the original client before calling runWithoutSession.

            Assignee:
            allison.easton@mongodb.com Allison Easton
            Reporter:
            allison.easton@mongodb.com Allison Easton
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: