[SERVER-47639] Fix race with async getHosts request and concurrent topology change Created: 17/Apr/20 Updated: 29/Oct/23 Resolved: 23/Jun/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.1, 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Lamont Nelson | Assignee: | Cheahuychou Mao |
| 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.4
|
||||||||||||
| Steps To Reproduce: | Given an initial topology T0, getHosts request R, and topology change event T that can satisfy R. 0. initial state: T0 cannot satisfy R |
||||||||||||
| Sprint: | Service arch 2020-05-04, Service arch 2020-05-18, Sharding 2020-06-29 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 16 | ||||||||||||
| Description |
|
See the steps in "Steps To Reproduce" below. A fix for this is to invoke server selection at the time of step 4 with a fresh view of the topology while synchronizing with the TopologyManager. The topology views (and corresponding topology change events) are serialized, so at step 4 we would either see T0 or T and would block any future topology changes while R is being enqueued. In the first case (we see T0), server selection would return no result, the request would be enqueued, and the query will be satisfied after T is applied to the topology manager. In the second case (we see T), the query will be satisfied without enqueuing the request. |
| Comments |
| Comment by Githook User [ 04/Aug/20 ] |
|
Author: {'name': 'Cheahuychou Mao', 'email': 'cheahuychou.mao@mongodb.com', 'username': 'cheahuychou'}Message: (cherry picked from commit 36bf915c32d551ad557ec7a1fa41890037e9f54f) |
| Comment by Githook User [ 23/Jun/20 ] |
|
Author: {'name': 'Cheahuychou Mao', 'email': 'cheahuychou.mao@mongodb.com', 'username': 'cheahuychou'}Message: |