-
Type: Task
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.14.0
-
Component/s: None
-
None
I am using the C driver (via mongo-cxx-driver) in pooled mode.
First, I create a pool using the URL mongodb://localhost:27017. The server is a standalone MongoDB 4.0.3 server.
Then, I destroy that pool and create a new pool using the URL mongodb://localhost:27017/?replicaset=rep. Afterwards, I stop the MongoDB server and start it again as a single replica set (with replica set name "rep"). I can successfully connect to the server using the Mongo shell (and e.g. call "rs.initiate()").
However, I cannot connect to the replica set using clients from the new pool in my program. Using APMĀ callbacks, it seems like the topology scanner does not get notified of the new configuration:
mongodb://localhost:27017: topology changed (5ca4c4969a183ffe80003b21) Single -> Single
?? previous servers:??
?? Standalone localhost:27017 (master)??
?? new servers:??
?? Standalone localhost:27017 (master)??
mongodb://localhost:27017: server changed (5ca4c4969a183ffe80003b21): localhost:27017 -> localhost:27017
mongodb://localhost:27017: topology changed (5ca4c4969a183ffe80003b21) Single -> Single
?? previous servers:??
?? Standalone localhost:27017 (master)??
?? new servers: Standalone localhost:27017 (master)??
mongodb://localhost:27017: topology closed (5ca4c4969a183ffe80003b21)
mongodb://localhost:27017/?replicaset=rep: topology opening (5ca4c4d99a183ffe80003b23)
mongodb://localhost:27017/?replicaset=rep: topology changed (5ca4c4d99a183ffe80003b23) Unknown -> ReplicaSetNoPrimary
mongodb://localhost:27017/?replicaset=rep: server opening (5ca4c4d99a183ffe80003b23): localhost:27017
mongodb://localhost:27017/?replicaset=rep: server changed (5ca4c4d99a183ffe80003b23): localhost:27017 -> localhost:27017
mongodb://localhost:27017/?replicaset=rep: server closed (5ca4c4d99a183ffe80003b23): localhost:27017
mongodb://localhost:27017/?replicaset=rep: topology changed (5ca4c4d99a183ffe80003b23) ReplicaSetNoPrimary -> ReplicaSetNoPrimary
I am stuck as of now. The actual code is part of a larger code-base. If there is nothing else I could try, I could create a minimal working program which hopefully reproduces this.
Thanks in advance.
- related to
-
CDRIVER-3107 Warn when removing the last server from a topology
- Closed