[SERVER-56344] Test that secondaries with capped collections upgrading from FCV 4.4 to FCV 5.0 delete all documents over the cap after stepping up Created: 26/Apr/21  Updated: 29/Oct/23  Resolved: 04/May/21

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

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

Issue Links:
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-05-17
Participants:
Linked BF Score: 70

 Description   

In FCV 4.4, each node is responsible for deleting the excess documents in capped collections. This implies that capped deletes may not be synchronized between nodes at times. When upgraded to FCV 5.0, the primary will generate delete oplog entries for capped collections. However, if the secondary was behind in deleting excess documents while in FCV 4.4, the primary would have no way of knowing and it would delete the first document it sees in its capped collection. This would leave the capped collection in an inconsistent state across the nodes, until the secondary steps up and starts deleting documents it never had a chance to. The capped collection would be consistent across the replica set nodes once every secondary stepped up, for replica sets where this is possible.

 

Below is an example of this with a capped collection capacity of 4 documents:

Node 1 Node 2
Starts with docs 2-5 Starts with docs 1-5
isPrimary ...
Insert 6 ...
Delete 2 ...
... Insert 6
... Delete 2
... Left with 1 + 3-6
Stepdown ...
... New primary
... Insert 7
... Delete 1 + 3 (had an excess of one document always)
Insert 7 ...
Delete 1 (no-op) ...
Delete 3 ...


 Comments   
Comment by Githook User [ 04/May/21 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-56344 Test that secondaries with capped collections upgrading from FCV 4.4 to FCV 5.0 delete all documents over the cap after stepping up
Branch: master
https://github.com/mongodb/mongo/commit/680744a808cc4387a8d6fb7c2d22ebc448a5f97c

Generated at Thu Feb 08 05:39:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.