FIX: Primary replica will be unreachable when you use constant stream of new connections to connect to database in Read-Only Routing enabled AG in SQL Server

Applies to: SQL Server 2017 Developer on WindowsSQL Server 2017 Enterprise on WindowsSQL Server 2017 Enterprise Core on Windows

Symptoms


Assume that you have a Read-Only Routing enabled AlwaysOn Availability Group (AG) in Microsoft SQL Server 2016 or 2017. When you use constant stream of new connections to connect to the SQL Server database, the primary replica will become completely unreachable for few minutes even when the connection count is very low in the performance counter. Additionally, you may receive an error message that resembles the following:

Error: 17809, Severity: 20, State: 3

Could not connect because the maximum number of '%ld' user connections has already been reached. The system administrator can use sp_configure to increase the maximum value. The connection has been closed.%.*ls

Status


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

Resolution


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

About cumulative updates for SQL Server:

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

References


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