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

Make statementId in oplog faster

    • Replication
    • Fully Compatible
    • Repl 2023-11-13
    • 155

      For historical reasons the statement ID in the oplog can be absent, a single integer, or an array of integers. We currently represent this in the IDL class with a boost::optional<std::variant<int, vector<int>>>, which is inconvenient and inefficient. We have accessors which convert this to vector<int>, which makes it more convenient but means we do a heap allocation every time we access statement ID.

      Instead of doing this, we should represent the value in the IDL class with a vector or boost_smallvector, and the accessors can provide references. On serialization we can convert to absent/BSON integer/BSON vector depending on the number of values in the vector (we currently do this in the convenience layer).

            Assignee:
            matthew.russotto@mongodb.com Matthew Russotto
            Reporter:
            matthew.russotto@mongodb.com Matthew Russotto
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: