Improve ReplicationConsistencyMarkersImpl::_upsertOplogTruncateAfterPointDocument

XMLWordPrintableJSON

    • Replication
    • Fully Compatible
    • Repl 2023-11-27, Repl 2023-12-11, Repl 2023-12-25, Repl 2024-01-08, Repl 2024-01-22, Repl 2024-02-05
    • 0
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Going directly to the storage engine is cheaper then going through the query engine. It avoids the overhead of allocating/deallocating the QE stages and walking the associated extra code.

      ReplicationConsistencyMarkersImpl::_upsertOplogTruncateAfterPointDocument is called as part of writing replication changes. Changing it to use the storage engine api will reduce the instruction count. While the POC made the change in ReplicationConsistencyMarkersImpl, a better approach may be to make it with upsertById in storage engine impl. The ReplicationConsistencyMarkersImpl does cache the _id record id. It also bypasses the opobservers to saving time applying the change

      Note: I have not measured the perf of this change alone

      POC: https://github.com/10gen/mongo/commit/2f09e0eb2cdb1acdc8d23ab397c2f26647204fd5

              Assignee:
              Scott Li (Inactive)
              Reporter:
              Mark Benvenuto
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: