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

Setting lastApplied before startup recovery has finished causes race with reconstructing prepared transactions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • None
    • 4.4.2
    • None
    • None
    • ALL
    • v4.7, v4.4
    • Execution Team 2020-09-07, Execution Team 2020-09-21
    • 64

    Description

      When preparing a transaction, WT requires that the prepare timestamp is greater than the latest active read timestamp. To allow for this, we often expect readers to do untimestamped reads during startup to avoid conflicting with prepared transactions (which are only reconstructed at the end of recovery). One way we achieved this in the past was by only setting lastApplied at the end of recovery, so that anything that reads with a kLastApplied read source does an untimestamped read instead.

      However, we now set lastApplied on the snapshot manager before finishing recovery (and specifically before reconstructing prepared transactions). We do this to prevent a race with kNoOverlap that could cause a reader to see writes that shouldn't be visible. Ultimately, this means that operations reading with a kLastApplied read source during startup can race with reconstructing prepared transactions.

      Attachments

        Issue Links

          Activity

            People

              louis.williams@mongodb.com Louis Williams
              samy.lanka@mongodb.com Samyukta Lanka
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: