-
Type: Bug
-
Resolution: Fixed
-
Priority: Critical - P2
-
Affects Version/s: 2.5.3
-
Component/s: Server Selection
-
None
-
Environment:Ruby-2.3.3/2.3.7 MongoDB 3.2/3.4
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>