[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:
Backports
Related
is related to SERVER-64750 Only check isSelf for reconfigs when ... Closed
is related to SERVER-72980 Configurable replSetReconfig isSelf s... Backlog
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: SERVER-66050 findSelfInConfig should attempt fast path for every HostAndPort before trying slow path

(cherry picked from commit 0c0f80372c2adee56c16c106ec2711d39ea6b45f)
Branch: v6.0
https://github.com/mongodb/mongo/commit/d236fc19471e47350c5bd741e7363e4433aeab35

Comment by Githook User [ 13/Feb/23 ]

Author:

{'name': 'Matthew Russotto', 'email': 'matthew.russotto@mongodb.com', 'username': 'mtrussotto'}

Message: SERVER-66050 findSelfInConfig should attempt fast path for every HostAndPort before trying slow path

(cherry picked from commit 0c0f80372c2adee56c16c106ec2711d39ea6b45f)
Branch: v5.0
https://github.com/mongodb/mongo/commit/68caf3689f4f13b5f5d0bea9efeee410e663c259

Comment by Githook User [ 13/Feb/23 ]

Author:

{'name': 'Matthew Russotto', 'email': 'matthew.russotto@mongodb.com', 'username': 'mtrussotto'}

Message: SERVER-66050 findSelfInConfig should attempt fast path for every HostAndPort before trying slow path

(cherry picked from commit 0c0f80372c2adee56c16c106ec2711d39ea6b45f)
Branch: v4.4
https://github.com/mongodb/mongo/commit/cd276c3cb1bf8a9bca55537e1393a52349cccfc8

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.

Generated at Thu Feb 08 06:04:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.