[SERVER-36869] fsm capped collection checks should only make 1 query for assertions Created: 24/Aug/18  Updated: 29/Oct/23  Resolved: 27/Aug/18

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.0.3, 4.1.3

Type: Bug Priority: Major - P3
Reporter: David Bradford (Inactive) Assignee: David Bradford (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Participants:
Linked BF Score: 11

 Description   

In the fsm workloads create_capped_collection.js and create_capped_collection_maxdocs.js, we check the number of documents after truncations and the actual documents. This is done with 2 queries and the number of documents is used to assert that the actual documents are correct.

The problem is if the stepdown thread is running and the primary steps down between the 2 queries the results may not be consistent since capped collections are maintained independently in the replica set.

The same assertion could be done with a single query, which would remove the window in which a stepdown could cause problems.



 Comments   
Comment by Githook User [ 03/Sep/18 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-36869 Fix verifySizeTruncation() function when running w/ MMAPv1.
Branch: v4.0
https://github.com/mongodb/mongo/commit/0ee3eb06a905f7354da63c143a76ff7173d44fe4

Comment by Githook User [ 31/Aug/18 ]

Author:

{'name': 'David Bradford', 'email': 'david.bradford@mongodb.com', 'username': 'dbradf'}

Message: SERVER-36869: Only call find once for checking capped collection truncation

(cherry picked from commit 8143b34ed3ff6cb5eeecbc8f8cd9f009a82fe9c1)
Branch: v4.0
https://github.com/mongodb/mongo/commit/be5c961e3c8cd7a84e9d954462429deefb4165dc

Comment by Githook User [ 27/Aug/18 ]

Author:

{'name': 'David Bradford', 'email': 'david.bradford@mongodb.com', 'username': 'dbradf'}

Message: SERVER-36869: Only call find once for checking capped collection truncation
Branch: master
https://github.com/mongodb/mongo/commit/8143b34ed3ff6cb5eeecbc8f8cd9f009a82fe9c1

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