[SERVER-41036] Make ReadWriteAbility::_canAcceptNonLocalWrites AtomicWord<bool> to prevent torn reads. Created: 07/May/19 Updated: 29/Oct/23 Resolved: 09/May/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.22, 3.6.14, 4.1.12, 4.0.11 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Suganthi Mani | Assignee: | Vesselina Ratcheva (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Backport Requested: |
v4.0, v3.6, v3.4
|
||||||||||||
| Sprint: | Repl 2019-05-20 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
Currently, we are accessing _canAcceptNonLocalWrites in an unsafe manner by NOT taking any RSTL lock. This can lead to torn read/ undefined behavior if concurrently a step up/step down thread is modifying the value.
And, they all are best effort checks. So, it's ok to just make reading _canAcceptNonLocalWrites thread safe. |
| Comments |
| Comment by Githook User [ 10/Jul/19 ] |
|
Author: {'name': 'Vesselina Ratcheva', 'username': 'vessy-mongodb', 'email': 'vesselina.ratcheva@10gen.com'}Message: (cherry picked from commit 21746d3302f37a9d5716c2f249b99d7f0e273344) |
| Comment by Githook User [ 10/Jul/19 ] |
|
Author: {'name': 'Vesselina Ratcheva', 'email': 'vesselina.ratcheva@10gen.com', 'username': 'vessy-mongodb'}Message: (cherry picked from commit 21746d3302f37a9d5716c2f249b99d7f0e273344) |
| Comment by Githook User [ 10/Jul/19 ] |
|
Author: {'name': 'Vesselina Ratcheva', 'email': 'vesselina.ratcheva@10gen.com', 'username': 'vessy-mongodb'}Message: (cherry-picked from commit 21746d3302f37a9d5716c2f249b99d7f0e273344) |
| Comment by Githook User [ 09/May/19 ] |
|
Author: {'name': 'Vesselina Ratcheva', 'username': 'vessy-mongodb', 'email': 'vesselina.ratcheva@10gen.com'}Message: |