[SERVER-40248] OplogEntry's getOperationToApply() returns incorrect field for updates Created: 20/Mar/19  Updated: 29/Oct/23  Resolved: 08/May/19

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 4.0.6, 4.1.9
Fix Version/s: 4.1.11, 4.0.11

Type: Bug Priority: Major - P3
Reporter: Blake Oler Assignee: Judah Schvimer
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-40249 Select better variable names for migr... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Sprint: Repl 2019-04-22, Repl 2019-05-06, Repl 2019-05-20
Participants:

 Description   

The method getOperationToApply() states that it returns the document corresponding with the write operation for a given OplogEntry object. It asserts furthermore that for updates, this will be the o2 field. For updates, the o2 field will contain the document key – that is, the id (and the shard key if in a sharded cluster).

For sharding's use of this function, we always need a document that has at least the id and the shard key. The function should be renamed (or more functions should be created) accurately reflect its usages in both applyOps and sharding.

Bug was introduced in version 3.7.2.



 Comments   
Comment by Githook User [ 14/Jun/19 ]

Author:

{'name': 'Judah Schvimer', 'email': 'judah@mongodb.com', 'username': 'judahschvimer'}

Message: SERVER-40248 Return correct operation to apply for update oplog entries

(cherry picked from commit 19158a0271f4f240b3ab6f9109f7cf821af237a8)
Branch: v4.0
https://github.com/mongodb/mongo/commit/5f93fc9db3a3475dd2c7543b9f1e1179e6f9065f

Comment by Githook User [ 07/May/19 ]

Author:

{'email': 'judah@mongodb.com', 'name': 'Judah Schvimer', 'username': 'judahschvimer'}

Message: SERVER-40248 Return correct operation to apply for update oplog entries
Branch: master
https://github.com/mongodb/mongo/commit/19158a0271f4f240b3ab6f9109f7cf821af237a8

Comment by Blake Oler [ 20/Mar/19 ]

CC tess.avitabile

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