[SERVER-35385] _isSelf invoked unnecesarily on Debian-based distros Created: 04/Jun/18 Updated: 15/Apr/20 Resolved: 11/Jun/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Billy Donahue | Assignee: | DO NOT USE - Backlog - Platform Team |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | inject failure in _isSelf handler.
|
||||||||
| Participants: | |||||||||
| Linked BF Score: | 0 | ||||||||
| Description |
|
repl::isSelf has a fast path, and falls back to issuing _isSelf as a slow path. Ubuntu 18.04 workstation shows the same symptom. |
| Comments |
| Comment by Billy Donahue [ 05/Jun/18 ] |
|
I think Atlas nodes would take the fast path. They're going to be using automated rsconfigs that mention each host by a network-accessible IP address (or DNS name) that resolves to an exact number they'd recognize as one of their network interface addresses. The slow path is taken when we're dealing with the ambiguities of nslookup of Unix hostname, the 127/8 subnet, and bind_ip=0.0.0.0. It would just be unit tests, really. |
| Comment by Andy Schwerin [ 05/Jun/18 ] |
|
I think the isself shortcut behavior is a lot of code that delivers not much value. I'm curious if Atlas nodes meet the criteria for bypassing the check. If not, we should consider deleting the bypass code and always using the rpc to test for selfness. |
| Comment by Billy Donahue [ 04/Jun/18 ] |
|
This happens because the Unix hostname appears in the replset config of this 1-node repl unit test. getAddrsForHost("myhostname:20020") yields 127.0.1.1 on Debian systems, In the test, we're using --bindIp 0.0.0.0. When isSelf walks all the ifaces, it makes a list of local ip addresses to match against the addresses associated with the rsconfig-specified host. So even though we are listening on 127.0.1.1:20020, and our hostname locally resolves to it, we don't consider 127.0.1.1 to be our "self".
{ ]
|