[SERVER-32240] Don't include unnecessary $v field in oplog entries Created: 08/Dec/17  Updated: 06/Dec/22  Resolved: 03/Sep/20

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Justin Seyster Assignee: Backlog - Query Team (Inactive)
Resolution: Won't Do Votes: 1
Labels: former-quick-wins
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-30854 Remove ModifierInterface update code Closed
Assigned Teams:
Query
Participants:
Case:

 Description   

UpdateDriver::update() generates a "$v" field to indicate what version of the update language was used to apply the logged update, which is necessary for heterogeneous replica sets that may include nodes supporting multiple versions of the update language.

Any replica set that cannot include nodes with binVersion <= 3.6, however, can safely elide this field. Newer mongod versions will always apply updates with "kUpdateNode" semantics and will always assume "kUpdateNode" semantics from updates in the oplog.

Eliding the "$v" field will save some space in the oplog.



 Comments   
Comment by David Storch [ 03/Sep/20 ]

Closing as "Won't Do" per ian.boros's comment above. The $v field is now used to indicate the version of the oplog format used for updates. There are currently separate $v:1 and $v:2 encodings of oplog entries for updates. Even if we remove support for $v:1 in a future version, it may be helpful to keep the version number in place in order to future-proof the system for a hypothetical future implementation of $v:3.

Comment by Ian Boros [ 07/Jul/20 ]

I'm putting this into the shrink oplog entries epic so we can investigate closing it as "Won't Fix." At the time this ticket was filed, the $v field had only one possible value (on master) so eliding it made sense. In 4.6, nodes will use the $v field with value 2 to mark delta-style oplog entries.

Comment by Justin Seyster [ 08/Dec/17 ]

Will do. The "$v" field only lives in update documents and is new in 3.6, so I don't think it should affect backup or initial sync at all, but a consult won't hurt. This is something we have planned for a release or two in the future.

Comment by Andy Schwerin [ 08/Dec/17 ]

Please confer with a repl engineer before implementing this. It may have some impact on backup or initial sync.

Generated at Thu Feb 08 04:29:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.