[SERVER-66715] Avoid using AllowLockAcquisitionOnTimestampedUnitOfWork for the change collection Created: 24/May/22 Updated: 29/Oct/23 Resolved: 12/Apr/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Rishab Joshi (Inactive) | Assignee: | Mindaugas Malinauskas |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | pm-2334-followup, tech-debt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||
| Sprint: | QE 2023-02-06, QE 2023-02-20, QE 2023-03-06, QE 2023-03-20, QE 2023-04-03, QE 2023-04-17 | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Linked BF Score: | 135 | ||||||||||||||||||||||||||||
| Description |
|
The change collection when writing documents takes AllowLockAcquisitionOnTimestampedUnitOfWork. The AllowLockAcquisitionOnTimestampedUnitOfWork has some implications, for eg. it stalls replications. This ticket is about exploring solutions to avoid using it. One solution was to take the change collection within the context of the AutoGetCollection. This POC was done here but it was complicated and hard to reason for deadlocks. Another solution is to use an atomic flag. The insertion code path takes the reader lock and the drop collection takes the writer lock. The insertion logic will not block each other because they are using the reader lock. The drop and insertion code path will be synchronized using the writer lock. It should be noted that the insertions to the change collection are happening within the context of the timestamped unit of work, so they themselves are synchronized. |
| Comments |
| Comment by Githook User [ 12/Apr/23 ] |
|
Author: {'name': 'Mindaugas Malinauskas', 'email': 'mindaugas.malinauskas@mongodb.com', 'username': ''}Message: |
| Comment by Githook User [ 05/Apr/23 ] |
|
Author: {'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}Message: Revert " This reverts commit b9d8a47872050ca5fe6c1b95fcb0534e6e0ebc3d. |
| Comment by Githook User [ 04/Apr/23 ] |
|
Author: {'name': 'Mindaugas Malinauskas', 'email': 'mindaugas.malinauskas@mongodb.com', 'username': ''}Message: |
| Comment by Mindaugas Malinauskas [ 27/Oct/22 ] |
|
Added a link to the ticket |