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

Fix OplogBatcher getOpCount() to include all kinds of applyOps

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • Repl 2023-04-03

    Description

      The OplogBatcher counts the oplog entries to decide when to start a new batch, however for applyOps entries, the current counting mechanism is incorrect: it uses the 'count' field in applyOps, but this field only exists for non-initial implicit commit and prepare entries. So for single entry applyOps entries, the 'count' field does not exist and we would just return 1. This is a bug today and might become a bigger problem after PM-2780 where we might group up normal CRUD in an applyOps entry.

      The original intention of not having 'count' field in single entry applyOps seems to be that we can derive it from the applyOps array, however do that is bit expensive, so I think it's better to have 'count' field in single entry applyOps as well.

      Attachments

        Activity

          People

            wenbin.zhu@mongodb.com Wenbin Zhu
            wenbin.zhu@mongodb.com Wenbin Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: