[SERVER-14078] Verify >1 local interface works with isself Created: 28/May/14  Updated: 11/Jul/16  Resolved: 05/Jun/14

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 2.7.2

Type: Bug Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Matt Dannenberg
Resolution: Done Votes: 0
Labels: cap-ticket-needed
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-11776 Replication 'isself' check should all... Closed
is related to SERVER-14165 fix isSelf() to compare against all i... Closed
Tested
Operating System: ALL
Steps To Reproduce:
  1. Create a second loopback interface with IP address 127.0.0.2.
  2. Start mongod with bindip of 127.0.0.1 on default port as part of replset "rs1"
  3. Start mongod with bindip of 127.0.0.2 on default port as part of replset "rs1"
  4. Run rs.initiate() with a config containing both hosts.

Expected behavior is successful initiation and correctly behaving replica set.

Suspected actual behavior: uassert with code 13278, maybe 13279.

Participants:

 Description   

The isself code currently seems to be less than correct if more than one local interface is used as it treats them all as the same host, so isself will return true when it shouldn't.



 Comments   
Comment by Githook User [ 05/Jun/14 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-14078 adapt isSelf to work with multiple local interfaces
Branch: master
https://github.com/mongodb/mongo/commit/580141520aab378006d3c8d36daad42813886b88

Comment by Matt Dannenberg [ 29/May/14 ]

Repro'd:

> conf = {_id: "rs0", members: [{host: "127.0.0.1:27017", _id:0}, {host: "127.0.0.2:27017", _id:1}]}
{
        "_id" : "rs0",
        "members" : [
                {
                        "host" : "127.0.0.1:27017",
                        "_id" : 0
                },
                {
                        "host" : "127.0.0.2:27017",
                        "_id" : 1
                }
        ]
}
> rs.initiate(conf)
{
        "ok" : 0,
        "errmsg" : "couldn't initiate : bad config: isSelf is true for multiple hosts: 127.0.0.1:27017,127.0.0.2:27017"
}
> 

Comment by Eric Milkie [ 29/May/14 ]

Matt, give this test a try to confirm the (suspected) erroneous behavior.

Generated at Thu Feb 08 03:33:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.