Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4999

all hostnames should be compared case insensitively

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Networking
    • Service Arch
    • ALL
    • Service Arch 2019-04-22, Service Arch 2019-05-06, Service Arch 2019-05-20
    • 35

      It seems like addshard treats hostnames case-sensitively, which is inconsistent with how hostnames work in DNS.

      Here's my replica set, addshard failures below. (I know that using localhost adds some extra stupid to the problem, but I don't have a routable hostname to test with right now.)

      > rs.conf()
      {
              "_id" : "a",
              "version" : 3,
              "members" : [
                      {
                              "_id" : 0,
                              "host" : "LOCALHOST:27017"
                      },
                      {
                              "_id" : 1,
                              "host" : "LOCALHOST:27018"
                      },
                      {
                              "_id" : 2,
                              "host" : "LOCALHOST:27019"
                      }
              ]
      }
      

      Here are a bunch of attempts to add it as a shard:

      mongos> db.adminCommand({addShard:"a/localhost"})
      {
              "ok" : 0,
              "errmsg" : "in seed list a/localhost, host localhost:27017 does not belong to replica set a"
      }
      mongos> db.adminCommand({addShard:"a/localhost:27017"})
      {
              "ok" : 0,
              "errmsg" : "in seed list a/localhost:27017, host localhost:27017 does not belong to replica set a"
      }
      mongos> db.adminCommand({addShard:"a/localhost:27017,localhost:27018"})
      {
              "ok" : 0,
              "errmsg" : "in seed list a/localhost:27017,localhost:27018, host localhost:27017 does not belong to replica set a"
      }
      mongos> db.adminCommand({addShard:"localhost:27017"})
      {
              "ok" : 0,
              "errmsg" : "host is part of set: a use replica set url format <setname>/<server1>,<server2>,...."
      }
      mongos> db.adminCommand({addShard:"LOCALHOST:27017"})
      {
              "ok" : 0,
              "errmsg" : "can't use localhost as a shard since all shards need to communicate. either use all shards and configdbs in localhost or all in actual IPs  host: LOCALHOST:27017 isLocalHost:0"
      }
      mongos> db.adminCommand({addShard:"a/LOCALHOST:27017"})
      {
              "ok" : 0,
              "errmsg" : "can't use localhost as a shard since all shards need to communicate. either use all shards and configdbs in localhost or all in actual IPs  host: LOCALHOST:27017 isLocalHost:0"
      }
      mongos> db.adminCommand({addShard:"a/LOCALHOST:27017,LOCALHOST:27018"})
      {
              "ok" : 0,
              "errmsg" : "can't use localhost as a shard since all shards need to communicate. either use all shards and configdbs in localhost or all in actual IPs  host: LOCALHOST:27017 isLocalHost:0"
      }
      

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            richard.kreuter Richard Kreuter (Inactive)
            Votes:
            5 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: