[SERVER-53299] AutoGetCollectionForReadLockFree is checking repl state multiple times without holding RSTL Created: 09/Dec/20 Updated: 29/Oct/23 Resolved: 14/Dec/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Bug | 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 | ||||
| Operating System: | ALL | ||||
| Sprint: | Execution Team 2020-12-14, Execution Team 2020-12-28 | ||||
| Participants: | |||||
| Linked BF Score: | 15 | ||||
| Description |
|
SnapshotHelper::shouldReadAtLastApplied is called explicitly from AutoGetCollectionForReadBase and via SnapshotHelper::getNewReadSource. It is checking ReplicationCoordinator::canAcceptWritesForDatabase which can change as we're not holding the RSTL. A different answer would trigger the following fassert: https://github.com/mongodb/mongo/blob/51e3e36ac48cac80c920e5e418013fdb0a6747f2/src/mongo/db/db_raii.cpp#L262-L265 |
| Comments |
| Comment by Githook User [ 14/Dec/20 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: |