[SERVER-67761] Add "lastCommittedOpTime" field to scrub() function in set_param1.js Created: 01/Jul/22  Updated: 29/Oct/23  Resolved: 25/Jul/22

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

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

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Server Serverless 2022-07-25, Server Serverless 2022-08-08
Participants:
Linked BF Score: 0

 Description   

set_param1.js starts with a test that attempts to update a logLevel field, revert it, then check for equivalency between the new and old documents.  However, the assertion performs the check on the entire document, which contains many fields outside the scope of the test.  This opens the test up to issues involving concurrency when other threads or processes modify the underlying document between the time we retrieve the old document and when we retrieve the new document, making the test brittle.  Previously, another team has attempted to address the brittleness by adding a scrub() function that removes fields from the documents outside the scope of the test, but a more robust test would be simply to assert on fields within the scope of the test, in this case logLevel.  In their case, they needed to deal with fields starting with "failpoint.", and in our case the affect field is "lastCommittedOpTime".

As a race-type issue, occurrences are rare, but it may still be worth asking around to determine the intent of the test and see if we might be able to modify it to assert only on the logLevel field, otherwise the suggested course of action is to add the "lastCommittedOpTime" to the scrub() function.



 Comments   
Comment by Githook User [ 18/Jul/22 ]

Author:

{'name': 'Hugh Tong', 'email': 'hugh.tong@mongodb.com', 'username': 'cortrain'}

Message: SERVER-67761 Add lastCommittedOpTime field to scrub() function
Branch: master
https://github.com/mongodb/mongo/commit/9b1eb092c79d03cc49d4e5faf1f0d9641612601b

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