[SERVER-66050] findSelfInConfig should attempt fast path for every HostAndPort before trying slow path Created: 28/Apr/22 Updated: 29/Oct/23 Resolved: 18/Aug/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.19, 5.0.15, 6.1.0-rc0, 6.0.5 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Xuerui Fa | Assignee: | Matthew Russotto |
| 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: |
v6.0, v5.0, v4.4, v4.2
|
||||||||||||||||
| Sprint: | Repl 2022-09-05 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
Currently, when we run findSelfInConfig, the isSelf logic checks the fast path for a specific HostAndPort and uses the slow path if it does not succeed. Ideally, it should run the fast path for all HostAndPorts, and if any of them don't succeed, then we should move on to the slow path. This should speed up the discovery time. |
| Comments |
| Comment by Githook User [ 13/Feb/23 ] |
|
Author: {'name': 'Matthew Russotto', 'email': 'matthew.russotto@mongodb.com', 'username': 'mtrussotto'}Message: (cherry picked from commit 0c0f80372c2adee56c16c106ec2711d39ea6b45f) |
| Comment by Githook User [ 13/Feb/23 ] |
|
Author: {'name': 'Matthew Russotto', 'email': 'matthew.russotto@mongodb.com', 'username': 'mtrussotto'}Message: (cherry picked from commit 0c0f80372c2adee56c16c106ec2711d39ea6b45f) |
| Comment by Githook User [ 13/Feb/23 ] |
|
Author: {'name': 'Matthew Russotto', 'email': 'matthew.russotto@mongodb.com', 'username': 'mtrussotto'}Message: (cherry picked from commit 0c0f80372c2adee56c16c106ec2711d39ea6b45f) |
| Comment by Matthew Russotto [ 04/Aug/22 ] |
|
Currently the code executes the slow path for all nodes which aren't 'isSelf' by the fast path. After this change, we will not execute the slow path for any node if a node which is 'isSelf' by the fast path is identified. This means we will potentially miss declaring the configuration invalid if, by mistake, the new configuration includes the same node twice by different host names (if one of those host names cannot be resolved by the fast path). The advantage is that if a node is identified by the fast path, we will save a lot of time and potentially avoid failures when nodes are down in such a way that they would time out on the isSelf query. Since configuration changes may be prompted by the system being unhealthy, this seems like a reasonable tradeoff. |