[SERVER-77131] Remove and ban any write to collection instance in commit handlers Created: 15/May/23  Updated: 29/Oct/23  Resolved: 11/Oct/23

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

Type: Improvement Priority: Major - P3
Reporter: Henrik Edin Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-77062 Perform copy-on-write of index catalo... Closed
Duplicate
duplicates SERVER-77130 Fix data races when writing to collec... Closed
Related
related to SERVER-81297 Simplify CollectionIndexUsageTracker Closed
Assigned Teams:
Storage Execution NAMER
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2023-06-12, Execution NAMR Team 2023-06-26, Execution NAMR Team 2023-10-02, Execution NAMR Team 2023-10-16
Participants:

 Description   

It is not safe to write to collection or index catalog entry instances in commit handlers. Cloned instances as part of DDL operations can be returned to other threads doing lock-free reads after the DDL operation is committed to the storage engine but before its commit handlers have run. Any such write requires synchronization and goes against the design philosophy that readers should obtain immutable instances that are fully in sync with the opened storage snapshot.

To help find and prevent future misuse we should consider publishing new collection instances in the first commit handler rather than the last.



 Comments   
Comment by Githook User [ 11/Oct/23 ]

Author:

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

Message: SERVER-77131 Removed dropped flag on IndexCatalogEntry

An index that is marked ready in the index catalog can no longer be marked as dropped.
Branch: master
https://github.com/mongodb/mongo/commit/2bd245299ad0e006dd9f5971169412b000959f40

Comment by Githook User [ 28/Jul/23 ]

Author:

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

Message: SERVER-77131 Remove write to index entry instance in IndexRemoveChange commit handler
Branch: master
https://github.com/mongodb/mongo/commit/5944235d7cd94eb59a34c97374977d00ffb2edb5

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