Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1337

mongo cannot detect primary after upgrading from 2.4.3 to 2.5.x

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: 2.5.3
    • Fix Version/s: 2.6.0
    • Component/s: Server Selection
    • Labels:
      None
    • Environment:
      Ruby-2.3.3/2.3.7 MongoDB 3.2/3.4

      Description

      Env.

      docker run -p 30001:27017 --name mongodb mongo:3.4 mongod --replSet rs 
      docker exec -it mongodb mongo --eval "rs.initiate()"
      

      Mongo 2.4.3 works well.

      2.3.3 :001 > gem 'mongo','2.4.3'; require 'mongo'; client = Mongo::Client.new(['127.0.0.1:30001'])
      DEBUG -- : MONGODB | Topology type 'unknown' initializing.
      DEBUG -- : MONGODB | Server 127.0.0.1:30001 initializing.
      DEBUG -- : MONGODB | Server description for 127.0.0.1:30001 changed from 'unknown' to 'primary'.
      DEBUG -- : MONGODB | Server xxx:27017 initializing.
      DEBUG -- : MONGODB | getaddrinfo: nodename nor servname provided, or not known
      DEBUG -- : MONGODB | Topology type 'unknown' changed to type 'replica set'.
      DEBUG -- : MONGODB | There was a change in the members of the 'replica set' topology.
       => #<Mongo::Client:0x70171873xxxxxx cluster=127.0.0.1:30001, xxx:27017>
      

      Mongo 2.5.3 cannot detect primary.

      2.3.3 :001 > gem 'mongo','2.5.3'; require 'mongo'; client = Mongo::Client.new(['127.0.0.1:30001'])
      DEBUG -- : MONGODB | Topology type 'unknown' initializing.
      DEBUG -- : MONGODB | Server 127.0.0.1:30001 initializing.
      DEBUG -- : MONGODB | Server description for 127.0.0.1:30001 changed from 'unknown' to 'unknown'.
      DEBUG -- : MONGODB | Server xxx:27017 initializing.
      DEBUG -- : MONGODB | getaddrinfo: nodename nor servname provided, or not known
      DEBUG -- : MONGODB | There was a change in the members of the 'unknown' topology.
      DEBUG -- : MONGODB | There was a change in the members of the 'unknown' topology.
       => #<Mongo::Client:0x70113311xxxxxx cluster=127.0.0.1:30001, xxx:27017>
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: