-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
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).
- causes
-
SERVER-83198 createOplogEntryWithNStatementIds uses BSONObjBuilder::done() in a place where it should use BSONObjBuilder::obj()
- Closed