Prevent movePrimary from bubbling up WriteConflict exceptions

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL
    • CAR Team 2025-07-21, CAR Team 2025-08-04
    • 200
    • None
    • 3
    • TBD
    • 🟥 DDL
    • None
    • None
    • None
    • None
    • None
    • None

      After the changes in SERVER-106590, we are no longer holding the DB X lock during movePrimary cloning. We are also now acquiring collection locks before creating the collection/indexes. Collection acquisitions (and auto getters) can throw WriteConflict exceptions if the collection changes during the acquisition. Since the new acquisitions are outside of the WriteConflictRetry loop, this means that movePrimary can now throw WriteConflictExceptions which bubble up to the user.

       

      We should move the acquisitions within the WriteConflictRetry loops so that movePrimary does not fail with this retryable error.

              Assignee:
              Allison Easton
              Reporter:
              Jordi Olivares Provencio
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: