[SERVER-54803] StreamableReplicaSetMonitor registers a new topology listener per call to getHostsOrRefresh Created: 25/Feb/21 Updated: 29/Oct/23 Resolved: 08/Jun/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Networking |
| Affects Version/s: | 4.4.4 |
| Fix Version/s: | 4.4.5, 5.0.0-rc1, 5.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Matthew Saltz (Inactive) | Assignee: | Lamont Nelson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | bkp, sharding-wfbf-day | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v5.0, v4.4
|
||||||||
| Sprint: | Service Arch 2021-03-22 | ||||||||
| Participants: | |||||||||
| Case: | (copied to CRM) | ||||||||
| Story Points: | 4 | ||||||||
| Description |
|
Whenever StreamableReplicaSetMonitor::getHostsOrRefresh is called (which happens on every query), if the result isn't immediately available, we enqueue a query object for that host, to be resolved when the host becomes available. As part of enqueuing a query, we unconditionally register the query processor as an event listener for topology changes. We only remove that listener when all outstanding queries are satisfied, but that won't happen as long as the node the RSM is targeting is down or unable to be contacted. Registering a listener does not do any deduplication to check whether the passed-in pointer is the same, which means the list of listeners will continue to grow as long as there are new queries. It also means that every time there's a topology change event, ALL of those listeners will then call requestImmediateCheck.
We should change it so that the RSM _queryProcessor topology listener is only registered at most once. |
| Comments |
| Comment by Githook User [ 08/Jun/21 ] |
|
Author: {'name': 'Matthew Saltz', 'email': 'matthew.saltz@mongodb.com', 'username': 'saltzm'}Message: (cherry picked from commit d6394bb39aae0ae99cfeeb9569203de2ff98e11a) |
| Comment by Githook User [ 07/Jun/21 ] |
|
Author: {'name': 'Matthew Saltz', 'email': 'matthew.saltz@mongodb.com', 'username': 'saltzm'}Message: |
| Comment by Lamont Nelson [ 26/May/21 ] |
|
This shouldn't conflict with |
| Comment by Matthew Saltz (Inactive) [ 18/Mar/21 ] |
|
Re-opening and opening a 4.4 Backport ticket, which I'll then immediately close since the commit went straight to the 4.4 branch |
| Comment by Githook User [ 18/Mar/21 ] |
|
Author: {'name': 'Matthew Saltz', 'email': 'matthew.saltz@mongodb.com', 'username': 'saltzm'}Message: |