Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transient errors during SQL Server failovers

Tags:

c#

sql

sql-server

We have a client application accessing a SQL Server database (mirrored and clustered) through a C# dll with retry logic on specific error numbers.

We are having issues during fail overs where transient errors are being thrown by the .dll where catching them in retry logic would have allowed the client application to continue elegantly after the fail over.

Here is a list of errors we currently catch in the retry logic:

0 
-2
-1
2 
53
64
233
596
924
1205
1222
2801
4060
6005
10053
10054
10060
40143
40197
40501
40613

Does anyone know of a more comprehensive list of errors which the DB could throw during a fail over, which is recoverable once the fail over is complete?

Their must be loads of software out their that has had to deal with these, but I can't seem to find a decent list.

Thanks, Chris.

like image 694
ChrisMurray Avatar asked Apr 22 '16 13:04

ChrisMurray


People also ask

What is SQL transient error?

A transient error, also known as a transient fault, has an underlying cause that soon resolves itself. An occasional cause of transient errors is when the Azure system quickly shifts hardware resources to better load-balance various workloads. Most of these reconfiguration events finish in less than 60 seconds.

What causes a transient error?

A transient error is an error that arises from a temporary condition that might be resolved or corrected quickly, such as the unavailability of a resource due to network issues or failure to connect to a database. A transient error is caused by a run-time exception.

What is a transient failure?

Transient failures include the momentary loss of network access to components and services, the brief unavailability of a service, and timeouts that occur when a service is busy. However, ever since these defects became widespread, experts have identified a pattern to deal with them.


2 Answers

Due to the apparent lack of a universal list, we have gone down the route of retrying on all errors which leave the connection in a broken state.

like image 132
ChrisMurray Avatar answered Sep 29 '22 08:09

ChrisMurray


I think this guys here had a similar problem, might want to check.

Is there an overview of all SQL Server 2012 error codes?

like image 29
Rafael Avatar answered Sep 29 '22 08:09

Rafael