[SERVER-53535] Rename with dropTarget must be done atomically in the catalog to prevent a lock free reader to observe intermediate invalid state Created: 29/Dec/20 Updated: 29/Oct/23 Resolved: 06/Jan/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Task | 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: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | Execution Team 2021-01-11 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 50 | ||||||||||||
| Description |
|
Rename with dropTarget=true is performed in two phases with each phase is writing to the catalog while holding a MODE_X lock for the collection. As holding a MODE_X lock does not prevent a lock free reader it may observe the collection as dropped as this is written to the in-memory catalog separately from the rename: This whole operation must be performed atomically in a single catalog write as MODE_X lock mode cannot be used to prevent readers anymore. |
| Comments |
| Comment by Githook User [ 06/Jan/21 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: Collection drops are now implemented with correct isolation where the catalog is only updated after a successful commit so a lock free reader may not observe intermediate invalid state. |