[SERVER-49696] ReplicaSetMonitor does not randomize host order for getHosts Created: 17/Jul/20 Updated: 29/Oct/23 Resolved: 22/Jul/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.0-rc14 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Benjamin Caimano (Inactive) | Assignee: | Lamont Nelson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v4.4
|
||||||||
| Steps To Reproduce: | I've attached a javascript test that sends reads in sequence to a 3 node shard and confirms that the third node is not used. |
||||||||
| Sprint: | Sharding 2020-07-27 | ||||||||
| Participants: | |||||||||
| Description |
|
Original description: While there is a function to randomly select, it is only used for single host selection here. This has implications for both connection reuse and read hedging. It means that if we have available connections to all hosts, we will always choose the first one in order if there is an available connection, essentially prioritizing that host. If we are hedging reads, we will also chose the second one in order for our hedge, which prioritizes yet another host and makes that host the one considered the "hedge" for our statistics. We should randomize the multiple host selection here as well. |
| Comments |
| Comment by Githook User [ 22/Jul/20 ] |
|
Author: {'name': 'LaMont Nelson', 'email': 'lamont.nelson@mongodb.com', 'username': 'lamontnelson'}Message: (cherry picked from commit 6fc13dc855f3ead1678072e4b9bf9ab645e5fd49) |
| Comment by Githook User [ 22/Jul/20 ] |
|
Author: {'name': 'LaMont Nelson', 'email': 'lamont.nelson@mongodb.com', 'username': 'lamontnelson'}Message: |
| Comment by Lamont Nelson [ 21/Jul/20 ] |
|
https://evergreen.mongodb.com/version/5f172cc39ccd4e7feacd1092 |