Skip to content

Commit 6168bf7

Browse files
author
Simonx Xu
authored
Merge pull request #8267 from JamesFerebee/jaferebe_sql2019cu31updateforreadscale
AB#199870: Add known issue 2
2 parents 72f0378 + 8187fad commit 6168bf7

File tree

1 file changed

+117
-4
lines changed

1 file changed

+117
-4
lines changed

support/sql/releases/sqlserver-2019/cumulativeupdate31.md

Lines changed: 117 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Cumulative update 31 for SQL Server 2019 (KB5049296)
3-
description: This article contains the summary, known issues, improvements, fixes and other information for SQL Server 2019 cumulative update 31 (KB5049296).
4-
ms.date: 02/13/2025
3+
description: This article contains the summary, known issues, improvements, fixes, and other information for SQL Server 2019 cumulative update 31 (KB5049296).
4+
ms.date: 02/24/2025
55
ms.custom: sap:Installation, Patching, Upgrade, Uninstall, evergreen, KB5049296
66
ms.reviewer: v-qianli2
77
appliesto:
@@ -23,15 +23,128 @@ This article describes Cumulative Update package 31 (CU31) for Microsoft SQL Ser
2323

2424
## Known issues in this update
2525

26-
### Access violation when session is reset
26+
### Issue one: Access violation when session is reset
2727

2828
SQL Server 2019 CU14 introduced a [fix to address wrong results in parallel plans returned by the built-in SESSION_CONTEXT](https://support.microsoft.com/help/5008114). However, this fix might create access violation dump files when the SESSION is reset for reuse. To mitigate this issue and avoid incorrect results, you can disable the original fix, and also disable the parallelism for the built-in `SESSION_CONTEXT`. To do this, use the following trace flags:
2929

3030
- 11042 - This trace flag disables the parallelism for the built-in `SESSION_CONTEXT`.
3131

3232
- 9432 - This trace flag disables the fix that was introduced in SQL Server 2019 CU14.
3333

34-
Microsoft is working on a fix for this issue and it will be available in a future CU.
34+
### Issue two: Patching a read-scale availability group (Windows or Linux) causes the availability group on the patched replica to be removed
35+
36+
If you use the read-scale availability group (AG) feature in SQL Server on Windows or Linux, you should **not** install this CU.
37+
38+
This CU introduced [a fix to support AG names longer than 64 characters](#3548672). However, when the patch is installed on an instance that has the read-scale AG configured, the AG metadata is dropped. This issue affects read-scale AGs in both [Windows](/sql/database-engine/availability-groups/windows/read-scale-availability-groups) and [Linux](/sql/linux/sql-server-linux-availability-group-configure-rs), which means that the `CLUSTER_TYPE` of the AG is either `NONE` or `EXTERNAL`.
39+
40+
When the AG is dropped after patching, you'll see the error message in the [SQL Server error log](/sql/tools/configuration-manager/viewing-the-sql-server-error-log) similar to the following one:
41+
42+
```output
43+
<DateTime> Error: 19433, Severity: 16, State: 1.
44+
<DateTime> Always On: AG integrity check failed to find AG name to ID map entry with matching group ID for AG '<AGName>' (expected: '<AGName>'; found '<GUID Value>').
45+
<DateTime> Always On: The local replica of availability group '<AGName>' is being removed. The instance of SQL Server failed to validate the integrity of the availability group configuration in the Windows Server Failover Clustering (WSFC) store. This is expected if the availability group has been removed from another instance of SQL Server. This is an informational message only. No user action is required.
46+
```
47+
48+
After the patch is installed, the metadata is removed and you must re-create the AG on the patched replica. If the AG replicas have mismatched SQL Server versions (for example, the primary replica is running SQL Server 2019 CU30 and the secondary replica is running SQL Server 2019 CU31), you can't re-create the AG on the replica with the missing metadata (the secondary replica). In order to add the AG again, you must uninstall the patch on the secondary replica first and then add the AG again.
49+
50+
#### Example
51+
52+
You can use steps that are similar to the following ones, but you need to update them for the given environment, including the `CLUSTER_TYPE`. The VM1 in the given example is the primary replica of the AG 'readscaleag' and VM2 is the secondary replica that has the patch applied but already uninstalled. Before running the script, both replicas VM1 and VM2 are running SQL Server 2019 CU30 and the AG metadata is missing on VM2. To run this script, use [SQLCMD mode](/sql/tools/sqlcmd/edit-sqlcmd-scripts-query-editor).
53+
54+
```sql
55+
-- You must run this query in SQLCMD mode
56+
:setvar PrimaryServer "VM1\SQL19"
57+
:setvar SecondaryServer "VM2\SQL19"
58+
:setvar AvailabilityGroupName "readscaleag"
59+
:setvar EndpointURL "TCP://VM2.Contoso.lab:5022"
60+
:setvar DatabaseName "testReadScaleAGDb"
61+
:setvar ClusterType "NONE"
62+
63+
-- Connect to primary server
64+
:CONNECT $(PrimaryServer)
65+
66+
-- Remove replica on secondary server
67+
ALTER AVAILABILITY GROUP $(AvailabilityGroupName) REMOVE REPLICA ON N'$(SecondaryServer)';
68+
GO
69+
70+
-- Connect to primary server again
71+
:CONNECT $(PrimaryServer)
72+
73+
USE [master];
74+
GO
75+
76+
-- Add replica on secondary server
77+
ALTER AVAILABILITY GROUP $(AvailabilityGroupName)
78+
ADD REPLICA ON N'$(SecondaryServer)' WITH (
79+
ENDPOINT_URL = N'$(EndpointURL)',
80+
FAILOVER_MODE = MANUAL,
81+
AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT,
82+
BACKUP_PRIORITY = 50,
83+
SECONDARY_ROLE(ALLOW_CONNECTIONS = NO)
84+
);
85+
GO
86+
87+
-- Connect to secondary server
88+
:CONNECT $(SecondaryServer)
89+
90+
-- Join availability group with cluster type none
91+
ALTER AVAILABILITY GROUP $(AvailabilityGroupName) JOIN WITH (CLUSTER_TYPE = N'$(ClusterType)');
92+
GO
93+
94+
-- Connect to secondary server again
95+
:CONNECT $(SecondaryServer)
96+
97+
-- Set database to availability group
98+
-- Wait for the replica to start communicating
99+
BEGIN TRY
100+
DECLARE @conn BIT;
101+
DECLARE @count INT;
102+
DECLARE @replica_id UNIQUEIDENTIFIER;
103+
DECLARE @group_id UNIQUEIDENTIFIER;
104+
105+
SET @conn = 0;
106+
SET @count = 30; -- wait for 5 minutes
107+
108+
IF (SERVERPROPERTY('IsHadrEnabled') = 1)
109+
AND (ISNULL((SELECT member_state
110+
FROM master.sys.dm_hadr_cluster_members
111+
WHERE UPPER(member_name COLLATE Latin1_General_CI_AS) = UPPER(CAST(SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS NVARCHAR(256)) COLLATE Latin1_General_CI_AS)), 0) <> 0)
112+
AND (ISNULL((SELECT state
113+
FROM master.sys.database_mirroring_endpoints), 1) = 0)
114+
BEGIN
115+
SELECT @group_id = ags.group_id
116+
FROM master.sys.availability_groups AS ags
117+
WHERE name = N'$(AvailabilityGroupName)';
118+
119+
SELECT @replica_id = replicas.replica_id
120+
FROM master.sys.availability_replicas AS replicas
121+
WHERE UPPER(replicas.replica_server_name COLLATE Latin1_General_CI_AS) = UPPER(@@SERVERNAME COLLATE Latin1_General_CI_AS)
122+
AND group_id = @group_id;
123+
124+
WHILE @conn <> 1 AND @count > 0
125+
BEGIN
126+
SET @conn = ISNULL((SELECT connected_state
127+
FROM master.sys.dm_hadr_availability_replica_states AS states
128+
WHERE states.replica_id = @replica_id), 1);
129+
IF @conn = 1
130+
BEGIN
131+
-- exit loop when the replica is connected, or if the query cannot find the replica status
132+
BREAK;
133+
END
134+
135+
WAITFOR DELAY '00:00:10';
136+
SET @count = @count - 1;
137+
END
138+
END
139+
END TRY
140+
BEGIN CATCH
141+
-- If the wait loop fails, do not stop execution of the alter database statement
142+
END CATCH
143+
144+
ALTER DATABASE $(DatabaseName) SET HADR AVAILABILITY GROUP = $(AvailabilityGroupName);
145+
GO
146+
GO
147+
```
35148

36149
## Improvements and fixes included in this update
37150

0 commit comments

Comments
 (0)