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

Data race for inReplicationRecovery between recovery thread and index builds

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Execution EMEA Team 2023-09-18, Execution EMEA Team 2023-10-02, CAR Team 2023-11-13
    • 5
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Index builds use temporary record stores, which are not supposed to track size adjustments (and check inReplicationRecovery). On resume, the temporary record stores are opened using the regular record store code path, causing them to track size adjustments.

      inReplicationRecovery is set to true in recoverFromOplog, but concurrent checks for inReplicationRecovery can be running before the recovery thread reaches that point. This is the case for index builds, which are restarted/resumed earlier in the recovery process, when rolling back the storage engine to the stable timestamp and re-opening the catalog (_recoverToStableTimestamp). This creates a race between an index build thread checking inReplicationRecovery and the rollback thread setting the flag.

            Assignee:
            yujin.kang@mongodb.com Yujin Kang Park
            Reporter:
            yujin.kang@mongodb.com Yujin Kang Park
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: