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

Index builds code can access an invalid BSONObj because the cursor was saved&restored at a lower level

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker - P1
    • Resolution: Fixed
    • None
    • 5.2.0, 5.0.4, 5.1.0-rc0
    • None
    • None
    • Fully Compatible
    • ALL
    • v5.1, v5.0
    • Execution Team 2021-10-18
    • 118

    Description

      This objToIndex BSONObj is pointing to a cursor, which can be saved/restored and no longer save the data to which objToIndex points. Save/restore was exercised further down the stack, because we were running a createIndex command on two indexes at once, so this loop further down the stack with a reference to objToIndex can hit a WCE, save/restore the cursor, and then keep trying to use the now invalid objToIndex/doc BSONObj for the second index.

      Recommendations: call getOwned() to assign a copy in objToIndex; or, update the objToIndex reference in the same lambda that restores the cursor.

      Attachments

        Issue Links

          Activity

            People

              dianna.hohensee@mongodb.com Dianna Hohensee
              dianna.hohensee@mongodb.com Dianna Hohensee
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: