[SERVER-36225] Do not hold replication mutex when calling getMinValid Created: 20/Jul/18 Updated: 29/Oct/23 Resolved: 07/Aug/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.7, 4.0.2, 4.1.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Matthew Russotto | Assignee: | Tess Avitabile (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 | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Backport Requested: |
v4.0, v3.6
|
||||||||||||||||
| Sprint: | Repl 2018-08-13 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 63 | ||||||||||||||||
| Description |
|
It is not valid to read collections while holding the replication mutex. The reason is that reading a collection takes the global lock, which may be held by another thread, and that thread may be waiting on the replication mutex (e.g. by calling getMyLastAppliedOpTime). Thus, _replicationProcess->getConsistencyMarkers->getMinValid must not be called with the replication mutex held, as it is in _finishLoadLocalConfig. I believe we may simply release the repl mutex before checking !lastOpTime.isNull() Then re-acquire after calling getMinValid() (and remove the else clause). |
| Comments |
| Comment by Githook User [ 08/Aug/18 ] |
|
Author: {'username': 'tessavitabile', 'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com'}Message: (cherry picked from commit 2c553eadb3b07fd324a7c4d5e8e02f21815d282e) |
| Comment by Githook User [ 08/Aug/18 ] |
|
Author: {'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com', 'username': 'tessavitabile'}Message: (cherry picked from commit 2c553eadb3b07fd324a7c4d5e8e02f21815d282e) |
| Comment by Githook User [ 07/Aug/18 ] |
|
Author: {'username': 'tessavitabile', 'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com'}Message: |
| Comment by Gregory McKeon (Inactive) [ 06/Aug/18 ] |
|
When we close this, we should close |