[SERVER-32918] Make OplogEntry class useful for partial oplog entries and incremental building Created: 26/Jan/18 Updated: 30/Oct/23 Resolved: 06/Feb/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.7.2 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Matthew Russotto | Assignee: | Siyuan Zhou |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | Repl 2018-02-12 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
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. |
| Comments |
| Comment by Githook User [ 09/Feb/18 ] |
|
Author: {'email': 'siyuan.zhou@mongodb.com', 'name': 'Siyuan Zhou', 'username': 'visualzhou'}Message: |
| Comment by Githook User [ 06/Feb/18 ] |
|
Author: {'email': 'siyuan.zhou@mongodb.com', 'name': 'Siyuan Zhou', 'username': 'visualzhou'}Message: |
| Comment by Githook User [ 06/Feb/18 ] |
|
Author: {'email': 'siyuan.zhou@mongodb.com', 'name': 'Siyuan Zhou', 'username': 'visualzhou'}Message: Author: Mark Benvenuto |
| Comment by Benety Goh [ 26/Jan/18 ] |
|
Perhaps similar to what we do for BSONObj, we can consider having some kind of OplogEntryBuilder? |
| Comment by Judah Schvimer [ 26/Jan/18 ] |
|
benety.goh recently made this immutable in |