Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

KB5025808 - Cumulative Update 21 for SQL Server 2019

Release Date:   June 15, 2023
Version:   15.0.4316.3

Summary

This article describes Cumulative Update package 21 (CU21) for Microsoft SQL Server 2019. This update contains 29 fixes that were issued after the release of SQL Server 2019 Cumulative Update 20, and it updates components in the following builds:

  • SQL Server - Product version: 15.0.4316.3, file version: 2019.150.4316.3
  • Analysis Services - Product version: 15.0.35.39, file version: 2018.150.35.39

Known issues in this update

Issue one

Queries that use the built-in SESSION_CONTEXT function might return incorrect results or trigger access violation (AV) dump files when run in parallel query plans. This issue occurs because of the manner in which SESSION_CONTEXT interacts with parallel execution threads, particularly if the session is reset for reuse.

For more information, see the Known issues section in SESSION_CONTEXT.

Issue two

This issue is caused by a change introduced in SQL Server 2019 CU20 for the Managed Instance link feature. Assume that the databases of an Always On availability group have one of the following conditions:

  • The databases use memory-optimized tables, the FileStream class, or multiple log files.

  • You upgrade a replica to this cumulative update. For example, the primary replica is upgraded to SQL Server 2019 CU21, and the secondary replica remains SQL Server 2019 CU19.

  • The databases indicate the "Not Synchronizing" status.

  • You review the sys.dm_exec_requests DMV and notice the DB STARTUP command is blocked on wait HADR_RECOVERY_WAIT_FOR_UNDO.

In this scenario, you restart the SQL Server instance hosting the primary replica of the availability group. Then the databases start to synchronize. Additionally, you might notice the following error messages logged in the SQL Server error log and Extended Event logs:

Error 9642, Severity 16, State 3: An error occurred in a Service Broker/Database Mirroring transport connection endpoint. Error: 8474, State: 11. (Near endpoint role: target, far endpoint address: '')

If you have applied this cumulative update to one or more secondary replicas and are currently not synchronizing with the primary replica, you can use the following steps to mitigate this issue:

  1. Add trace flag 12324 as a startup parameter on all replicas (including the primary replica). Restart the secondary replicas to activate this trace flag. Meanwhile, the primary replica should be synchronized with all secondary replicas restarted with trace flag 12324 as the startup parameter.

  2. After all secondary replicas are updated and restarted, fail over the primary replica, now as a secondary role, and restart it to enable trace flag 12324.

  3. Apply this cumulative update to the old primary replica and restart it in the secondary role.

  4. Remove trace flag 12324 as the startup parameter from all replicas, and disable trace flag 12324 on all replicas by executing the DBCC TRACEOFF(12324, -1) statement.

Note

Trace flag 12324 impacts only the Managed Instance Link feature and is only used to activate the changes in SQL Server 2019 CU20 and CU21.

This issue is fixed in SQL Server 2019 CU22.

Improvements and fixes included in this update

A downloadable Excel workbook that contains a summary list of builds, together with their current support lifecycle, is available. The Excel file also contains detailed fix lists for SQL Server 2022, SQL Server 2019, and SQL Server 2017. Select to download this Excel file now.

Note

Individual entries in the following table can be referenced directly through a bookmark. If you select any bug reference ID in the table, a bookmark tag is added to the URL by using the "#NNNNNNN" format. You can then share this URL with others so that they can jump directly to the desired fix in the table.

For more information about the bugs that are fixed and enhancements that are included in this cumulative update, see the following Microsoft Knowledge Base articles.

Bug reference Description Fix area Component Platform
2354551 Adds an option for the Master Data Services (MDS) configuration tool to decide whether to enable the PerformanceImprovementEnable performance improvement setting. Master Data Services Master Data Services Windows
2367741 Fixes an issue where a hierarchy created in Master Data Services (MDS) doesn't expand correctly (on both the Edit Derived Hierarchy page and the Hierarchy page in the Explorer area). Master Data Services Master Data Services Windows
2375656 Fixes the following error that you may encounter when selecting any cell of a domain-based attribute column that has a different name and display name in a Master Data Services (MDS) entity and then selecting the drop-down arrow:

The current cell column title was not found. If the column title was changed, close the sheet and try again.
Master Data Services Master Data Services Windows
2385119 Updates the support for predicate pushdown when filtering on the session_id column of the sys.dm_exec_connections dynamic management view (DMV). SQL Connectivity SQL Connectivity All
2405054 Updates the version of the Microsoft ODBC driver to 17.10.4.1. For more information, see Release Notes for Microsoft ODBC Driver for SQL Server on Windows. SQL Connectivity SQL Connectivity Windows
2405058 Updates the version of the Microsoft OLE DB driver to 18.6.6. For more information, see Release notes for the Microsoft OLE DB Driver for SQL Server. SQL Connectivity SQL Connectivity Windows
2405087 Fixes an issue where applying the option ONLINE in the ALTER INDEX REBUILD statement is invalid when running the index rebuild task created in an index maintenance plan. SQL Server Client Tools Management Services All
2399354 Consider the following scenario:

- You have an instance of SQL Server that connects to Microsoft Entra ID.

- You enable Transport Layer Security (TLS) encryption on this instance of SQL Server.

In this scenario, you may receive the following error 39011 if you run the sp_execute_external_script query against the instance:

Msg 39011, Level 16, State 7, Line <LineNumber>
SQL Server was unable to communicate with the LaunchPad service for request id: <ID>. Please verify the configuration of the service.
SQL Server Engine Extensibility Linux
2375469 Fixes an issue where the following error occurs when you disable the FILESTREAM feature on a SQL Server failover cluster instance (FCI) by using SQL Server Configuration Manager (SSCM):

There was an unknown error applying FILESTREAM settings.
Check the parameters are valid. (0x800713d6)
SQL Server Engine FileStream and FileTable Windows
2195940 Fixes an issue where messages in the sys.transmission_queue of the initiator database in a SQL Server Service Broker conversation are missing or stuck after a failover of the target database. SQL Server Engine High Availability and Disaster Recovery All
2101590 Fixes an issue where restoring an In-Memory OLTP database backup that has Transparent data encryption (TDE) enabled fails and returns the following error message:

Error: 33126, Severity: 16, State: 1.
Database encryption key is corrupted and cannot be read.

Note: To apply this fix, you need to enable a trace flag (TF) to relax TDE checks for In-Memory tables and disable the TF after the restoration is completed. For more information, contact Microsoft Customer Service and Support.
SQL Server Engine In-Memory OLTP Windows
2184943 Fixes an assertion dump issue (Location: "sql\\ntdbms\\hekaton\\engine\\core\\tx.cpp":4753; Expression: 0 == Dependencies.CommitDepCountOut) that causes an availability group failover. SQL Server Engine In-Memory OLTP All
2347043 Provides the details of the corrupt checkpoint file that's associated with the in-memory database when you try to restore a database but it fails with the following error:

[ERROR] Recovery failed with error 0x84000004 on database 10. This error will be mapped to 'HK_E_RESTORE_ABORTED' (0x82000018). (sql\ntdbms\hekaton\runtime\src\hkruntime.cpp : 5051 - 'HkRtRestoreDatabase')
SQL Server Engine In-Memory OLTP Windows
2401115 Fixes a dump issue where a huge number of concurrent In-Memory OLTP transactions cause a stack overflow. SQL Server Engine In-Memory OLTP All
2404944 Removes the need for running the sys.sp_xtp_force_gc stored procedure twice to free up allocated and used XTP memory, and running it once is enough. You need at least the ALTER SERVER STATE permission to run this procedure. SQL Server Engine In-Memory OLTP All
2312800 Fixes an issue where external data sources that use the generic ODBC connector may not work after you install SQL Server 2019 CU19 or later versions. You may encounter the following scenarios:

- When you try to query an external table that was created before you install this fix on a generic ODBC data source, and the CONNECTION_OPTIONS argument uses a DSN parameter without the Driver keyword, you receive the following error message:

Msg 7320, Level 16, State 110, Line <LineNumber>
Cannot execute the query "Remote Query" against OLE DB provider "MSOLEDBSQL" for linked server "(null)". Object reference not set to an instance of an object.

- If you try to create a new external table, you receive the following error message:

Msg 110813, Level 16, State 1, Line <LineNumber>
Object reference not set to an instance of an object.

Note: Before you apply this fix, you can uninstall SQL Server 2019 CU19 or later versions, or add the Driver keyword to the CONNECTION_OPTIONS argument as a workaround. For more information, see Generic ODBC external data sources may not work after installing Cumulative Update.
SQL Server Engine PolyBase Windows
2117672 Fixes an issue that can cause the query execution to encounter an access violation error when the query has an aggregate function or a GROUP BY clause against a columnstore table that contains data in uncompressed row groups, and the cleanup may sometimes not complete correctly.

Note: Before you apply this cumulative update, you can rebuild the columnstore index to move all data into compressed row groups as a workaround.
SQL Server Engine Query Execution Windows
2346939 Fixes an assertion failure (Location: tmpilb.cpp:3540; Expression: RTL_ASSERTSZ(fFalse, "Attempt to access expired blob handle (1)")) and the following errors that you encounter when you run a common language runtime (CLR) stored procedure twice:

Msg 3624, Level 20, State 1, Procedure <ProcedureName>, Line <LineNumber> [Batch Start Line <LineNumber>]
A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a Hotfix from Technical Support.

Msg 596, Level 21, State 1, Line <LineNumber>
Cannot continue the execution because the session is in the kill state.

Msg 0, Level 20, State 0, Line <LineNumber>
A severe error occurred on the current command.  The results, if any, should be discarded.
SQL Server Engine Query Execution All
2307898 Fixes incorrect results for queries that filter on ROW_NUMBER and involve nullable columns. SQL Server Engine Query Optimizer All
2313620 Fixes the following errors and access violations that are caused by an incorrect plan in the case of multiple occurrences of the same scalar subquery:

Msg 596, Level 21, State 1, Line <LineNumber>
Cannot continue the execution because the session is in the kill state.

Msg 0, Level 20, State 0, Line <LineNumber>
A severe error occurred on the current command.  The results, if any, should be discarded.
SQL Server Engine Query Optimizer All
2363303 Improves the cardinality estimation (CE) for "AND" conjunctions that are composed of point predicates when the predicates have a multi-column statistic covering them, and the predicate values are outside the histogram bounds. SQL Server Engine Query Optimizer All
2391556 Fixes inconsistent results that are caused by the parallel spool in the plan for the INSERT, UPDATE, or DELETE query. SQL Server Engine Query Optimizer All
2266806 Adds a new error 673 that helps avoid the assertion failure (Location: IndexRowScanner.cpp:1449; Expression: m_versionStatus.IsVisible ()) that you might encounter when you enable change tracking on a database that has snapshot isolation turned on.

Error message:

Failure to access row object in snapshot isolation.

Note: You need to turn on trace flag 8285.
SQL Server Engine Replication All
2320889 Fixes an issue where applying an update on a secondary replica or performing an in-place upgrade fails when the distribution database is in an availability group. The following error is returned:

Error: There was an error executing the Replication upgrade scripts. See the SQL Server error log for details.

You can see the following error details in the SQL Server error log:

Executing sp_vupgrade_replication.
Could not open distribution database distribution because it is offline or being recovered. Replication settings and system objects could not be upgraded. Be sure this database is available and run sp_vupgrade_replication again.
SQL Server Engine Replication Windows
2421435 Fixes a manual cleanup issue where the repeated lock escalations on the tables cause contention and slowness in cleaning up the expired change tracking metadata.

Note: You need to turn on trace flag 8284.
SQL Server Engine Replication All
2397659 FIX: SQL Server Audit Events fail to write to the Security log (KB4052136) SQL Server Engine Security Infrastructure Windows
2409008 Fixes error 207 (Invalid column name '<ColumnName>') that you encounter when you run a user-defined function (UDF), which references a dropped column that uses dynamic data masking (DDM). SQL Server Engine Security Infrastructure All
2410400 SOS_BLOCKALLOCPARTIALLIST spinlock contention and elevated CPU utilization occur on large-memory machines.

DBCC DROPCLEANBUFFERS provides temporary mitigation for this issue when encountered.

This occurs when multiple threads concurrently attempt to gain access to a spinlock-protected list used by the SQL operating system for memory management purposes.

The following trace flags are required to enable the fix:

- TF 8142 partitions list by count of CPU, up to 64 partitions

- TF 8145 modifies the partitioning to be count of soft-NUMA nodes

These trace flags must be applied as startup parameters to take effect.

If SOS_BLOCKALLOCPARTIALLIST spinlock contention is encountered and DBCC DROPCLEANBUFFERS provides temporary mitigation, it's recommended to apply this fix first with both trace flags, and remove Trace Flag 8145 only if symptoms persist.
SQL Server Engine SQL OS All
2330957 Fixes the following error that you encounter on the target instance when configuring a Service Broker communication with transport security and the certificate serial number length is greater than 16 bytes:

The certificate serial number size is 19, however it must be no greater than 16 bytes in length. This occurred in the message with Conversation ID, Initiator: 1, and Message sequence number: 0.
SQL Server Engine SQL Server Engine All

How to obtain or download this or the latest cumulative update package

File information

Notes for this update

How to uninstall this update

References


Feedback

Was this page helpful?

Additional resources