MongoDB Switchover at application side

I have a mongod replication cluster as PSA architecture. I have configured the connection string in application which includes both primary and secondary servers ip and port, which helps to direct write and read queries to primary or secondary node.

Now when I stepdown the primary node, then my secondary node becomes primary node with the help of arbiter’s vote. At database side there is no issue like I can still connect to primary node whichever it is. But while application is connected to the primary and I do the switchover, application should be able to redirect its pointing to new primary node. But that is not the case. I need to stop the application services and then start again for the application to connect to new primary node.

But that is not the case for PSS cluster. In this case application is able to redirect its pointing to new primary node without any restart.

Why is it and what is the difference between two clusters? Is PSA cluster useless even in test/UAT environemt?

Hi @Vishal_Ghodake and welcome to the community forum :wave:

The PSA architecture works differently than PSS architecture in general. There have been issues in the past while making the connection when the read concern is set to “majority” in the connection string.

It would be helpful if you could help me with the MongoDB version you are using and the driver version that you are using at the application end?

Also, could you help me with connection string you are using as well?

The above information would help the community to understand the issue in more detail and help you with a possible solution.

Best Regards