The applications will typically experience an error. A running query will fail, and if the application tries to reuse a connection from the connection pool that will also fail in many cases. But applications can be written to be resilient to such things. That is, they can capture such errors and retry.
AG Failover vs connections
Hi all, If an automatic failover occur on an AG, will the connections of the applications be disconnected from the cluster or will this failover be totally transparent to the applications using it? Best regards. Carl
SQL Server | Other
-
Erland Sommarskog 121.9K Reputation points MVP Volunteer Moderator
2023-04-05T21:53:54.7+00:00
1 additional answer
Sort by: Most helpful
-
ZoeHui-MSFT 41,491 Reputation points
2023-04-06T03:19:52.8+00:00 Hi @Carl Bruneau,
When an availability group failover occurs, existing persistent connections to the availability group are terminated and the client must establish a new connection in order to continue working with the same primary database or read-only secondary database. While a failover is occurring on the server side, connectivity to the availability group may fail, forcing the client application to retry connecting until the primary is brought fully back online.
Regards,
Zoe Hui
If the answer is helpful, please click "Accept Answer" and upvote it.