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

Make OplogEntry class useful for partial oplog entries and incremental building

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.2
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • Repl 2018-02-12

      The current repl::OplogEntry class is immutable and requires a full oplog entry with all required fields such as oplog timestamp, hash, and version. For the transactions project we will sometimes need a representation of partial oplog entries (in particular, the subops of applyOp) and will sometimes need to build oplog entries incrementally (so, e.g., the optime can be set later).

      We will need to

      1) Change the IDE for OplogEntryBase so all fields (except possibly opType) are optional, and the structure is no longer immutable.

      2) Move the checks for the required fields into the parse() and toBson() methods on OplogEntry.

      3) Create separate methods which allow partial parsing and toBson without checking all the fields.

      4) Use "const OplogEntry" in existing uses where immutability is desired.

            Assignee:
            siyuan.zhou@mongodb.com Siyuan Zhou
            Reporter:
            matthew.russotto@mongodb.com Matthew Russotto
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: