[SERVER-31808] HostAndPort for replSetInitiate() no longer finds hostname for localhost Created: 02/Nov/17  Updated: 30/Oct/23  Resolved: 28/Nov/17

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: None
Fix Version/s: 3.6.1, 3.7.1

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: bkp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
is caused by SERVER-31464 replSetInitiate with no explicit conf... Closed
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6
Steps To Reproduce:

1. Start mongod on an empty dbpath with:
./mongod --replSet foo

2. then start mongo and issue this command:
rs.initiate()

Expected: successful command.
Actual: error about not being able to connect to ":27017".

Sprint: Platforms 2017-11-13, Platforms 2017-12-04
Participants:
Linked BF Score: 0

 Description   

The function someHostAndPortForMe() in repl_set_commands.cpp used to find my hostname for localhost as defined by /etc/hosts; as of 3.5.13, it no longer does so. There is some crazy logic in that function that may have been broken by recent network changes.



 Comments   
Comment by Githook User [ 12/Dec/17 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-31808 don't boost::split an empty bind_ip string

(cherry picked from commit 697db2c561f006cb9e1be9312e72c5072dd12530)
Branch: v3.6
https://github.com/mongodb/mongo/commit/b81115b17322f4afc41de1d4a06ba60f6193e544

Comment by Gregory McKeon (Inactive) [ 30/Nov/17 ]

billy.donahue is the final fixversion here then 3.7.1?

Comment by Billy Donahue [ 28/Nov/17 ]

Sorry for all the metadata traffic. I'm confused because I think "fixversion" is overloaded to mean both a planned target and an actual target, so I tagged the ticket hoping for 3.6.0-rc5 to get the fix.

There were 5 commits altogether on master. A 2-commit dead end, 2 commits reverting the dead end, and then a 1-commit fix.

Change 1: "SERVER-31808 Query vector<SockAddr> from TransportLayer"
[a1d7841f95f88bcb0fbeb37d7ce40382840c7b90]

Change 2: Clang-format fix of change 1.
[2f39019347c45fb4da6dd06ed9a0164ea690aecc]

Change 3: Revert change 2.
[bc838981fc3be57d1669a7bc46315333d2f659fc]

Change 4: Revert Change 1.
[89f1b2f3cd2e3dcd877cba84304a10213708a559]

Change 5: Minimal fix of boost::bind bug, The real fix.
[697db2c561f006cb9e1be9312e72c5072dd12530]

Comment by Githook User [ 20/Nov/17 ]

Author:

{'name': 'Billy Donahue', 'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com'}

Message: SERVER-31808 don't boost::split an empty bind_ip string

lint
Branch: master
https://github.com/mongodb/mongo/commit/697db2c561f006cb9e1be9312e72c5072dd12530

Comment by Billy Donahue [ 15/Nov/17 ]

Didn't actually pass evergreen testing.
Rolling back first attempt at fix from master and from v3.6 branch.

Comment by Githook User [ 15/Nov/17 ]

Author:

{'name': 'Billy Donahue', 'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com'}

Message: Revert "SERVER-31808 Query vector<SockAddr> from TransportLayer"

This reverts commit d641ef7968a26a3b84de584faff7437caef748b9.
Branch: v3.6
https://github.com/mongodb/mongo/commit/c748c45d62048c93f9fb4764662b5e2d22d241ad

Comment by Githook User [ 15/Nov/17 ]

Author:

{'name': 'Billy Donahue', 'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com'}

Message: Revert "SERVER-31808 fix lint"

This reverts commit 301ffaedeecaad53df28106191485b4c76c2d86b.
Branch: v3.6
https://github.com/mongodb/mongo/commit/a784a196d212faded16bd8d11fa1f9368d4e60b0

Comment by Githook User [ 15/Nov/17 ]

Author:

{'name': 'Billy Donahue', 'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com'}

Message: Revert "SERVER-31808 Query vector<SockAddr> from TransportLayer"

This reverts commit a1d7841f95f88bcb0fbeb37d7ce40382840c7b90.
Branch: master
https://github.com/mongodb/mongo/commit/89f1b2f3cd2e3dcd877cba84304a10213708a559

Comment by Githook User [ 15/Nov/17 ]

Author:

{'name': 'Jason Carey', 'username': 'hanumantmk', 'email': 'jcarey@argv.me'}

Message: SERVER-31808 fix lint
Branch: v3.6
https://github.com/mongodb/mongo/commit/301ffaedeecaad53df28106191485b4c76c2d86b

Comment by Githook User [ 15/Nov/17 ]

Author:

{'name': 'Billy Donahue', 'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com'}

Message: SERVER-31808 Query vector<SockAddr> from TransportLayer
Branch: v3.6
https://github.com/mongodb/mongo/commit/d641ef7968a26a3b84de584faff7437caef748b9

Comment by Githook User [ 15/Nov/17 ]

Author:

{'name': 'Billy Donahue', 'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com'}

Message: SERVER-31808 Query vector<SockAddr> from TransportLayer
Branch: master
https://github.com/mongodb/mongo/commit/a1d7841f95f88bcb0fbeb37d7ce40382840c7b90

Comment by Susan LoVerso [ 03/Nov/17 ]

And the simple solution from milkie for 3.5.13 (using --bind_ip 127.0.0.1 when starting mongod) does not work in 3.5.12. So for now I have to have my command for 3.5.12 and earlier to leave off the --bind_ip and a separate one for 3.5.13 and later to include --bind_ip.

Comment by Eric Milkie [ 02/Nov/17 ]

It would appear so. This case (no --bind_ip parameter supplied to mongod) is not one of the scenarios tested by the new js tests for that ticket.

Comment by Max Hirschhorn [ 02/Nov/17 ]

Is this fallout from SERVER-31464?

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