BSONObjBuilder could be accessed after being destroyed by obj() call on movePrimary

XMLWordPrintableJSON

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

      SERVER-106590 relaxed the database lock from MODE_X to MODE_IX in order to allow concurrent migrations on the same DB to be executed. In the cloner code, this means that now a concurrent migration can sneak in and make a WriteConflict exception when it's trying to create the collection. This is an expected behavior, however, during the first execution of the collection creation obj() could've been called on a BSONObjBuilder that is currently being created in another scope. This is a problem for a second execution of the retry loop, because it was previously invalidated.

        1. SERVER-107734.patch
          5 kB
          Marcos José Grillo Ramirez

            Assignee:
            Marcos José Grillo Ramirez
            Reporter:
            Marcos José Grillo Ramirez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: