What happens to open transactions when failling over (Always on)

In the case of a manual failover, what happens to open transactions.  Are they killed (rolled back), completed, a little bit of both?

Does the status of the query has any impact (are running queries handled differently then waiting ones, does the type of wait have an impact...)

I am using synchronous commit mode and all I seem to find is reference to the potential or absense of loss of data.

September 3rd, 2015 9:34am

Because you are in synchronous commit mode, transactions are considered committed only when they are persisted on the LDF files on both replicas. So, when an AG fails over to a secondary replica, an open transaction will be rolled back because it has not been committed on the original primary replica. Now, even if the transaction committed on the original primary replica but not persisted on the LDF file on the secondary replica, it is still not considered a fully committed transaction from the point of view of the AG.
Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2015 12:38pm

Please see:

http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-130-in-flight-transactions-continue-after-a-failover/

September 3rd, 2015 1:08pm

You are using Synchronous commit mode. That means your secondary replica commits first and then commits data in Primary. 

Assume failover happen in the mean time. your secondary becomes primary and primary becomes secondary. The moment it become primary it will wait until data is synchronised.

Please read more on Availability groups  

Free Windows Admin Tool Kit Click here and download it now
September 4th, 2015 3:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics