AlwaysOn Availability Group that contains the SSISDB database remains in the "Resolving" state after a failover in SQL Server

Symptoms
Assume that the SSISDB database is a member of an AlwaysOn Availability Group, and that Availability Group fails over while a package from SSISDB is executing synchronously. In this situation, the Availability Group may remain in the "resolving" state on the (now formerly) primary replica until package execution completes.

In this scenario, the failover operation succeeds, but the Availability Group on the (newly) secondary replica remains in the resolving state until package execution completes. During this time, the SQL Server error log displays a message that resembles the following:

Nonqualified transactions are being rolled back in database SSISDB for an AlwaysOn Availability Groups state change. Estimated rollback completion: 0%. This is an informational message only. No user action is required.

Querying the session status shows that the session that was used to execute the job is in the KILLED/ROLLBACK state. If or when execution does complete, it may trigger errors such as the following:

Msg 0, Level 11, State 0, Line 6

A severe error occurred on the current command. The results, if any, should be discarded.

Msg 0, Level 20, State 0, Line 6

A severe error occurred on the current command. The results, if any, should be discarded.
Cause
This issue occurs because the threads that are used to execute the SSIS package are outside the control of the mechanism that's used to kill a SQL Server session. When a package is executed synchronously, this causes the execution of a loop that prevents SQL Server from terminating the session until package execution has completed. 
Workaround
To work around this issue, configure the SSIS package to execute asynchronously. Asynchronous package execution is the default behavior.
Properties

Article ID: 3139534 - Last Review: 02/02/2016 18:03:00 - Revision: 7.0

Microsoft SQL Server 2012 Business Intelligence, Microsoft SQL Server 2012 Enterprise, Microsoft SQL Server 2012 Enterprise Core, Microsoft SQL Server 2012 Standard, Microsoft SQL Server 2014 Business Intelligence, Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Enterprise Core, Microsoft SQL Server 2014 Standard

  • KB3139534
Feedback