Subject: [mongodb-user] Re: replica ghost set



Thanks Wan,The connection on the app side is being retried. Usually when this happens retires don't work.Is the fact that I was trying to connect somehow affected the server's ability to initialize the replica set?

On Tuesday, July 4, 2017 at 4:47:01 AM UTC+3, Wan Bachtiar wrote:

com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=host:port, type=REPLICA_SET_GHOST, roundTripTime=5.7 ms, state=CONNECTED}]

Hi Sagi,

Based on the exception message that you provided, the driver is aware that it’s connecting to type replica set but the replica set has not been initialised. See also MongoDB Java driver v3.2 MultiServerCluster.java L189-192

This may be a race condition in between the rs.initialize() and the time your application makes the connection. You could either put a wait logic, or retrieve replica status output from


\x3dAFQjCNHCgLdZKNmbV9xhAt8gHnhltfG0Qg';return true;">rs.status() before attempting to make connection.

Regards,

Wan.

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/6c4e8541-c7bd-4995-bf79-26236cc28fc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



Programming list archiving by: Enterprise Git Hosting