[SERVER-75336] Fix OplogBatcher getOpCount() to include all kinds of applyOps Created: 27/Mar/23  Updated: 29/Oct/23  Resolved: 30/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Wenbin Zhu Assignee: Wenbin Zhu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Repl 2023-04-03
Participants:

 Description   

The OplogBatcher counts the oplog entries to decide when to start a new batch, however for applyOps entries, the current counting mechanism is incorrect: it uses the 'count' field in applyOps, but this field only exists for non-initial implicit commit and prepare entries. So for single entry applyOps entries, the 'count' field does not exist and we would just return 1. This is a bug today and might become a bigger problem after PM-2780 where we might group up normal CRUD in an applyOps entry.

The original intention of not having 'count' field in single entry applyOps seems to be that we can derive it from the applyOps array, however do that is bit expensive, so I think it's better to have 'count' field in single entry applyOps as well.



 Comments   
Comment by Githook User [ 30/Mar/23 ]

Author:

{'name': 'Wenbin Zhu', 'email': 'wenbin.zhu@mongodb.com', 'username': 'WenbinZhu'}

Message: SERVER-75336 Fix OplogBatcher getOpCount() to include all kinds of applyOps.
Branch: master
https://github.com/mongodb/mongo/commit/fb32caa0d6086523ddea815b90b6c261ff224fa8

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