I have already coveredswitchoverand failover. In the case of failover, the old primary is offline so there are no options for migrating clients from the old primary to the new primary. If there is a switchover, there are options for client migration. Assuming you are usingstreaming replication,only one server can accept writes. Therefore, for client migration, you can either:
Forceall clients on the old primary to exit, then promote the new primary
Waitfor all clients on the old primary to exit, then promote the new primary
If you chooseforce,it will disrupt applications; they must be designed to handle disconnections and potentially reconfigure their sessions, e.g., session variables, cursors, open transactions. If you choosewait,how do you handle clients that want to connect while you are waiting for the existing clients to disconnect? Minor upgrades, which require a restart of the database server, have similar issues.
The only clean solution is to usemulti-master replicationso new clients can connect to the new primary while waiting for old-primary clients to finish and disconnect. However, it is operationally expensive to support multi-master just to minimize switchover disruption.