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

Keep batch size accurate for oplog application of large unprepared transactions

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.10
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Fully Compatible
    • Storage NYC 2019-04-08, Storage NYC 2019-04-22

      Since there might be many operations in the same transaction, the oplog batcher needs to count in-transaction operations towards the batch size for “commit” of unprepared transaction, to keep the batch size of actually applied operations more accurate. In contrast, “prepare” and “commit” for prepared transactions are always applied in their own batches.

      We will count the number of operations by keeping the total number of operations in the “commitTransaction” command. The count doesn’t include the commit itself. With the new “count” field, the “o” field of commitTransaction oplog entry looks like:

      { "commitTransaction": 1, "prepared": false, "count": 2 }
      

      Operations in the same transaction must be applied in the same batch, even if the transaction size exceeds the current batch size. When this happens, the transaction can be scheduled into the next batch if it’s not the first operation in the batch.

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            siyuan.zhou@mongodb.com Siyuan Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: