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

Maintain the oldest active transaction timestamp only with the transaction table

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.1.9
    • Replication
    • None
    • Fully Compatible
    • Repl 2019-03-11

    Description

      The current plan for Prepare Support for Transactions uses an in-memory data structure to maintain the oldest active transaction timestamp. Instead, we can store the first oplog entry's timestamp of a transaction in the transaction table. Thus the transaction table has all necessary information to calculate the oldest active transaction timestamp. With SERVER-39679, this calculation may be done only when a checkpoint is taken or an initial sync starts, so its performance isn't a big concern. The updates on the transaction table are timestamped, so calculating the oldest require timestamp is just a read at the checkpoint's timestamp.

      If table scan's performance isn't good enough, we can add an index on the "firstTimestamp" field. The index can be a partial index on "firstTimestamp" when a new "active: true" field exists, so that retryable writes and finished transactions don't affect the performance.

      Attachments

        Issue Links

          Activity

            People

              jesse@mongodb.com A. Jesse Jiryu Davis
              siyuan.zhou@mongodb.com Siyuan Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: