FIX: Service Broker endpoint connections aren't closed after an availability group failover in SQL Server

Applies to: SQL Server 2014 DeveloperSQL Server 2014 EnterpriseSQL Server 2014 Enterprise Core

Symptoms


Assume that you have a SQL Service Broker (SSB) application deployed as part of Always On availability groups (AGs) in Microsoft SQL Server, and then you use AG listener to connect. After an AG failover, the SSB outgoing connections on the original primary replica are left open. This causes SSB incoming messages to be dropped because the databases are read-only or inaccessible.

Therefore, it manifests that SSB messages are stuck in the transmission queue, and more than one Service Broker connections exist in the AG.

Resolution


Cumulative Update Information for SQL Server:

This issue is fixed in the following cumulative updates for SQL Server:

Cumulative Update 6 for SQL Server 2016 RTM

Cumulative Update 3 for SQL Server 2016 SP1

Cumulative Update 5 for SQL Server 2014 SP2

Cumulative Update 12 for SQL Server 2014 SP1

Note With this fix, SQL Server will close both incoming and outgoing SSB connections to the old primary Availability Group replica during failover, so that the messages which were getting dropped prior to this fix, will remain in the queue and they will get redirected to the new primary replica as soon as connections are established with the new primary replica, leaving no dropped or missing messages.

Service Pack Information for SQL Server:

This issue is fixed in the following service packs for SQL Server:

       Service Pack 4 for SQL Server 2012

       Service Pack 2 for SQL Server 2016

For more information about how to obtain the latest service pack, see How to obtain the latest service pack for SQL Server 2012

About Service packs for SQL Server

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References


Learn about the terminology that Microsoft uses to describe software updates.