[SERVER-48981] Implement local isolation for fastcount for Biggie RecordStore Created: 18/Jun/20  Updated: 27/Oct/23  Resolved: 03/May/22

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

Type: Task Priority: Major - P3
Reporter: Henrik Edin Assignee: Backlog - Storage Execution Team
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-44837 Collection validation can cause inacc... Closed
Assigned Teams:
Storage Execution
Sprint: Execution Team 2020-06-29, Execution Team 2020-07-13
Participants:

 Description   

Biggie implements fastcount similar to how it is implemented on WT. The fastcount get updated immediately on inserts and deletes before the write unit of work is committed. In case of a rollback it is adjusted back.

However write conflicts on the biggie engine happens at commit time leading to the fastcount will be wrong until the commit where the write conflict is thrown.

Running jstests/concurrency/fsm_workloads/upsert_unique_index.js over biggie triggers the following assert: https://github.com/mongodb/mongo/blob/e57156eff2a2ff5dbb1b6a75fee246241206453f/src/mongo/db/storage/biggie/biggie_record_store.cpp#L576

The fastcount will go negative during the test above



 Comments   
Comment by Louis Williams [ 03/May/22 ]

Closing because we have removed EphemeralForTest

Comment by Githook User [ 13/Jul/20 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-48981 Remove invariant to guard against negative fastcount for biggie.

Local isolation of the count is required to prevent negative values because how this storage engine emits write conflict exceptions.
Branch: master
https://github.com/mongodb/mongo/commit/37dee01bca27a957c5bef67121fe8dc93a6554c1

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