-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Overview
As part of SERVER-116413, assertOplogEntriesEq in jstests/libs/replsettest.js was updated so that "new primary" noop oplog entries are allowed to compare equal even when the fields in the o sub-document are in different orders on the primary vs. the secondaries. The comparison falls back to bsonUnorderedFieldsCompare rather than bsonBinaryEqual for these specific entries.
Scope of Work
Investigate whether the primary and secondaries can be made to generate the "new primary" noop oplog entry with consistent field ordering, which would allow this special case in assertOplogEntriesEq to be removed.
Code Reference
jstests/libs/replsettest.js:4191
// TODO SERVER\-XXXXXX: Investigate if "new primary" noop oplog entries can be generated with consistent // field ordering to avoid the need for this special case. if \( oplogEntry0.o && oplogEntry0.o.msg === "new primary" && oplogEntry1.o && oplogEntry1.o.msg === "new primary" && bsonUnorderedFieldsCompare\(oplogEntry0, oplogEntry1\) === 0 \) { return; }
Acceptance Criteria
* Determine whether "new primary" noop oplog entries can be generated with consistent field ordering on primary and secondaries
* If feasible, update the oplog generation path so that primary and secondaries produce identical o sub-documents byte-for-byte
* Remove the special-case handling from assertOplogEntriesEq in jstests/libs/replsettest.js