FIX: Message is not removed from transmission queue even though the ACK is received successfully in an AlwaysOn availability group in SQL Server 2012 or SQL Server 2014

Applies to: SQL Server 2012 DeveloperSQL Server 2012 EnterpriseSQL Server 2012 Standard More

Symptoms


Consider the following scenario:
  • You enable Microsoft SQL Server Service Broker (SSB) in SQL Server AlwaysOn Group database.
  • You shut down and restart the database.
  • Make sure that the Acknowledge (ACK) is received successfully.
In this scenario, message is not removed from transmission queue even though the ACK is received successfully.

Cause


The issue occurs because, when you start the database after the clean shut down, SQL Server does not check whether the transmission queue deferred delete task is reusable. It assumes that the transmission queue deferred delete task is ok.

Resolution


The issue was first fixed in the following cumulative update of SQL Server.

Cumulative Update 1 for SQL Server 2014

Cumulative Update 9 for SQL Server 2012 SP1

Workaround


To work around the issue, failover the SQL Server Availability Group to the secondary replica (and failback if it is required).

Status


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