KB5016884 - Cumulative Update 31 for SQL Server 2017
Release Date:
20/09/2022
Version:
14.0.3456.2
Important: Cumulative Update 31 is the last cumulative update for Microsoft SQL Server 2017. SQL Server 2017 is transitioned to extended support after October 11, 2022.
Summary
This article describes Cumulative Update package 31 (CU31) for Microsoft SQL Server 2017. This update contains 20 fixes that are issued after the release of SQL Server 2017 Cumulative Update 30, and it updates components to the following builds:
-
SQL Server - Product version: 14.0.3456.2, file version: 2017.140.3456.2
-
Analysis Services - Product version: 14.0.249.94, file version: 2017.140.249.94
Known issues in this update
Assume that a table used by replication uses a column that uses the NEWSEQUENTIALID function in the primary key. An error occurs when you attempt to apply the snapshot at the subscriber. Here are the command attempted and error messages:
-
Command attempted:
create procedure [sp_MSupd_PersonAddress]
@c1 int = NULL,
@c2 nvarchar(60) = NULL,
@c3 nvarchar(60) = NULL,
@c4 nvarchar(30) = NULL,
@c5 int = NULL,
@c6 nvarchar(15) = NULL,
@c7 [geography] = NULL,
@c8 uniqueidentifier = NULL,
@c9 datetime = NULL,
@pkc1 uniqueidentifier = NULL,
@bitmap binary(2)
as
begin
declare @primarykey_text nvarchar(100) = ''
if (substring(@bitmap,1,1) & 128 = 128)
begin
if @pkc1 is null
set @pkc1 = (newsequentialid())
update [Person].[
(Transaction sequence number: 0x0000002400000F30005500000000, Command ID: 7)
-
Error messages:
The newsequentialid() built-in function can only be used in a DEFAULT expression for a column of type 'uniqueidentifier' in a CREATE TABLE or ALTER TABLE statement. It cannot be combined with other operators to form a complex scalar expression. (Source: MSSQLServer, Error number: 302)
Get help: http://help/302
Note The only way to resolve this issue is to change the primary key column to the NEWID function while you take the snapshot and then set it back to the NEWSEQUENTIALID function after the snapshot is applied. You can run the following command:
ALTER TABLE [Person].[Address] DROP CONSTRAINT [PK_Address_rowguid]
GO
ALTER TABLE [Person].[Address] ADD CONSTRAINT [PK_Address_rowguid] DEFAULT (NEWID()) FOR [rowguid]
GO
ALTER TABLE [Person].[Address] DROP CONSTRAINT [PK_Address_rowguid]
GO
ALTER TABLE [Person].[Address] ADD CONSTRAINT [PK_Address_rowguid] DEFAULT (NEWSEQUENTIALID()) FOR [rowguid]
GO
Improvements and fixes included in this cumulative 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 2019 and SQL Server 2017. 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, you will notice that a bookmark tag is added to the URL by using this format: #bkmk_NNNNNNNN. You can then share this URL with others so that they can jump directly to the desired fix in the table.
Bug reference |
KB article number |
Description |
Fix area |
Platform |
||
---|---|---|---|---|---|---|
Resolves the Denial of Service (DoS) vulnerability for the Newtonsoft library in SQL Server 2017. |
Analysis Services |
Windows |
||||
The read-only request still goes to the read-write primary node in an Always On availability group when the read-only routing list node goes down. |
High Availability |
All |
||||
An assertion failure occurs on secondary replica when you use Always On availability groups in high-latency networks in SQL Server 2017. You may see this assertion failure in the error log: Assertion: File: <"e:\\b\\s3\\sources\\sql\\ntdbms\\storeng\\dfs\\trans\\lsnlocmap.cpp">, line=358 Failed Assertion = 'pos - pndx < map->EntryCount' |
High Availability |
All |
||||
Memory-optimized tempdb metadata (HkTempDB) keeps consuming memory under VARHEAP: LOB Page Allocator. |
In-Memory OLTP |
Windows |
||||
A memory leak occurs in the range index of in-memory tables after the parallel index scan. |
In-Memory OLTP |
All |
||||
A memory leak occurs under "Range Index Heap" on the in-memory table that has non-clustered indexes, whenever there are concurrent inserts. |
In-Memory OLTP |
All |
||||
Performance issues and deadlocks occur on SQL Server Agent in the msdb database that has automated backups. In addition, you see the following error messages in the SQL Server Agent log: <DateTime> SQLServer Error: 1205, Transaction (Process ID) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. <DateTime> Failed to retrieve job <JobID> from the server. |
Management Tools |
Windows |
||||
5017551 |
FIX: Installing SQL Server CUs may trigger IndexOutOfRangeException |
Setup & Install |
Windows |
|||
5017788 |
SQL performance |
All |
||||
A non-yielding scheduler dump occurs in sqldk!SOS_MemoryWorkSpace::Lookup. |
SQL performance |
All |
||||
Non-yielding dumps occur frequently on ColumnStoreAttributeCache::ColumnStoreColumnAttributeNode::GetSegmentById. |
SQL performance |
Windows |
||||
5018050 |
Improvement: Add new Azure SQL Database service tier options to the Stretch Database feature |
SQL Server Engine |
Windows |
|||
5018231 |
SQL Server Engine |
Windows |
||||
5008184 |
SQL Server Engine |
All |
||||
Error 9003 occurs with the incorrect log sequence number (LSN) when you do a subsequent restore after specifying the LSN at the virtual log file (VLF) boundary by using the RESTORE WITH STANDBY statement. Here is the error message: Msg 3013, Level 16, State 1, Line <LineNumber> RESTORE DATABASE is terminating abnormally. Msg 9003, Level 17, State 11, Line <LineNumber> The log scan number (<LogScanNumber>) passed to log scan in database '<DatabaseName>' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup. |
SQL Server Engine |
Windows |
||||
Error 208 occurs when you use the sp_changereplicationserverpasswords stored procedure to change stored passwords for the Microsoft SQL Server login used by replication agents. Here is the error message: Msg 208, Level 16, State 1, Procedure master.sys.sp_MSchangerepltablepasswords, Line <LineNumber> [Batch Start Line 0] Invalid object name 'MSreplservers'. |
SQL Server Engine |
Windows |
||||
High CPU usage occurs when you enable change tracking on a large number of tables and do automatic or manual cleanup of the change tracking tables. |
SQL Server Engine |
Windows |
||||
The FILESTREAM feature is not enabled after you restart the operating system because of race conditions from multiple instances of SQL Server. In the error log, you can see the following error message: Error: 5591, Severity: 16, State: 5. FILESTREAM feature is disabled. |
SQL Server Engine |
Windows |
||||
The filegroup IDs of the files that belong to the clone database can be incorrect if the source database has gaps in the filegroup IDs due to the removal of files or filegroups. When you try to insert data into the table that belongs to the incorrectly generated clone database, you receive an error message that resembles the following message: Msg 622, Level 16, State 3, Line <LineNumber> The filegroup "<FileGroupName>" has no files assigned to it. Tables, indexes, text columns, ntext columns, and image columns cannot be populated on this filegroup until a file is added. |
SQL Server Engine |
Windows |
||||
An access violation may occur after you apply SQL Server 2017 Cumulative Update 30 (CU30). This issue can occur when you perform a bulk insert operation followed by a SELECT statement in the same transaction, and the database's recovery model is either simple or bulk-logged. |
SQL Server Engine |
All |
How to obtain or download this or the latest cumulative update package
The following update is available from the Microsoft Download Center:
Download the latest cumulative update package for SQL Server 2017 now
If the download page does not appear, contact Microsoft Customer Service and Support to obtain the cumulative update package.
Note: After future cumulative updates are released for SQL Server 2017, this and all previous CUs can be downloaded from the Microsoft Update Catalog. However, we recommend that you always install the latest cumulative update that is available.
The following update is available from the Microsoft Update Catalog:
Download the cumulative update package for SQL Server 2017 CU 31 now
To update Linux to the latest CU, you must first have the Cumulative Update repository configured. Then, update your SQL Server packages by using the appropriate platform-specific update command.
For installation instructions and direct links to the CU package downloads, see the release notes.
File information
You can verify the download by computing the hash of the SQLServer2017-KB5016884-x64.exe file by running the following command:
certutil -hashfile SQLServer2017-KB5016884-x64.exe SHA256
File name |
SHA256 hash |
---|---|
SQLServer2017-KB5016884-x64.exe |
AE3554BA0A474B4D1A6B2D3BB7F00A4F6308DBE50178FFF67BAA8B21CC74DBC2 |
The English version of this package has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
x64-based versions SQL Server 2017 Analysis Services
SQL Server 2017 Database Services Common Core
SQL Server 2017 Data Quality Client
SQL Server 2017 Data Quality
SQL Server 2017 sql_dreplay_client
SQL Server 2017 sql_dreplay_controller
SQL Server 2017 Database Services Core Instance
SQL Server 2017 Database Services Core Shared
SQL Server 2017 sql_extensibility
SQL Server 2017 Full-Text Engine
SQL Server 2017 sql_inst_mr
SQL Server 2017 Integration Services
SQL Server 2017 sql_polybase_core_inst
SQL Server 2017 sql_shared_mr
SQL Server 2017 sql_tools_extensions
|
Notes for this update
To apply this Cumulative Update package, you must be running SQL Server 2017.
You may have to restart the computer after you apply this Cumulative Update package.
To use one of the hotfixes in this package, you do not have to make any changes to the registry.
This article also provides important information about the following situations:
-
Pacemaker : A behavioral change is made in distributions that use the latest available version of Pacemaker. Mitigation methods are provided.
-
Query Store : You must run this script if you use the Query Store and you have previously installed Microsoft SQL Server 2017 Cumulative Update 2 (CU2).
Analysis Services CU build version
Beginning in SQL Server 2017, the Analysis Services build version number and SQL Server Database Engine build version number do not match. For more information, see Verify Analysis Services cumulative update build version.
Cumulative updates (CU)
Cumulative updates (CU) are now available at the Microsoft Download Center.
Only the most recent CU that was released for SQL Server 2017 is available at the Download Center.
CU packages for Linux are available at https://packages.microsoft.com/.
Notes
-
Each new CU contains all the fixes that were included with the previous CU for the installed version of SQL Server.
-
SQL Server CUs are certified to the same levels as Service Packs, and should be installed at the same level of confidence.
-
We recommend ongoing, proactive installation of CUs as they become available according to these guidelines:
-
Historical data shows that a significant number of support cases involve an issue that has already been addressed in a released CU.
-
CUs may contain added value over and above hotfixes. This includes supportability, manageability, and reliability updates.
-
-
We recommend that you test CUs before you deploy them to production environments.
IMPORTANT
All distributions (including RHEL 7.3 and 7.4) that use the latest available Pacemaker package 1.1.18-11.el7 introduce a behavior change for the start-failure-is-fatal cluster setting if its value is false. This change affects the failover workflow. If a primary replica experiences an outage, the cluster is expected to fail over to one of the available secondary replicas. Instead, users will notice that the cluster keeps trying to start the failed primary replica. If that primary never comes online (because of a permanent outage), the cluster never fails over to another available secondary replica.
This issue affects all SQL Server versions, regardless of the cumulative update version that they are on.
To mitigate the issue, use either of the following methods.
Method 1
Follow these steps:
-
Remove the start-failure-is-fatal override from the existing cluster.
# RHEL, Ubuntu pcs property unset start-failure-is-fatal # or pcs property set start-failure-is-fatal=true # SLES crm configure property start-failure-is-fatal=true -
Decrease the cluster-recheck-interval value.
# RHEL, Ubuntu pcs property set cluster-recheck-interval=<Xmin> # SLES crm configure property cluster-recheck-interval=<Xmin> -
Add the failure-timeout meta property to each AG resource.
# RHEL, Ubuntu pcs resource update ag1 meta failure-timeout=60s # SLES crm configure edit ag1 # In the text editor, add `meta failure-timeout=60s` after any `param`s and before any `op`sNote In this code, substitute the value for <Xmin> as appropriate. If a replica goes down, the cluster tries to restart the replica at an interval that is bound by the failure-timeout value and the cluster-recheck-interval value. For example, if failure-timeout is set to 60 seconds and cluster-recheck-interval is set to 120 seconds, the restart is tried at an interval that is greater than 60 seconds but less than 120 seconds. We recommend that you set failure-timeout to 60s and cluster-recheck-interval to a value that is greater than 60 seconds. We recommend that you do not set cluster-recheck-interval to a small value. For more information, refer to the Pacemaker documentation or consult the system provider.
Method 2
Revert to Pacemaker version 1.1.16.
IMPORTANT
You must run this script if you use Query Store and you are updating from SQL Server 2017 Cumulative Update 2 (CU2) directly to SQL Server 2017 Cumulative Update 3 (CU3) or any later cumulative update. You do not have to run this script if you have previously installed SQL Server 2017 Cumulative Update 3 (CU3) or any later SQL Server 2017 cumulative update.
SET NOCOUNT ON;
DROP TABLE IF EXISTS #tmpUserDBs;
SELECT [database_id], 0 AS [IsDone]
INTO #tmpUserDBs
FROM master.sys.databases
WHERE [database_id] > 4
AND [state] = 0 -- must be ONLINE
AND is_read_only = 0 -- cannot be READ_ONLY
AND [database_id] NOT IN (SELECT dr.database_id FROM sys.dm_hadr_database_replica_states dr -- Except all local Always On secondary replicas
INNER JOIN sys.dm_hadr_availability_replica_states rs ON dr.group_id = rs.group_id
INNER JOIN sys.databases d ON dr.database_id = d.database_id
WHERE rs.role = 2 -- Is Secondary
AND dr.is_local = 1
AND rs.is_local = 1)
DECLARE @userDB sysname;
WHILE (SELECT COUNT([database_id]) FROM #tmpUserDBs WHERE [IsDone] = 0) > 0
BEGIN
SELECT TOP 1 @userDB = DB_NAME([database_id]) FROM #tmpUserDBs WHERE [IsDone] = 0
-- PRINT 'Working on database ' + @userDB
EXEC ('USE [' + @userDB + '];
DECLARE @clearPlan bigint, @clearQry bigint;
IF EXISTS (SELECT [actual_state] FROM sys.database_query_store_options WHERE [actual_state] IN (1,2))
BEGIN
IF EXISTS (SELECT plan_id FROM sys.query_store_plan WHERE engine_version = ''14.0.3008.27'')
BEGIN
DROP TABLE IF EXISTS #tmpclearPlans;
SELECT plan_id, query_id, 0 AS [IsDone]
INTO #tmpclearPlans
FROM sys.query_store_plan WHERE engine_version = ''14.0.3008.27''
WHILE (SELECT COUNT(plan_id) FROM #tmpclearPlans WHERE [IsDone] = 0) > 0
BEGIN
SELECT TOP 1 @clearPlan = plan_id, @clearQry = query_id FROM #tmpclearPlans WHERE [IsDone] = 0
EXECUTE sys.sp_query_store_unforce_plan @clearQry, @clearPlan;
EXECUTE sys.sp_query_store_remove_plan @clearPlan;
UPDATE #tmpclearPlans
SET [IsDone] = 1
WHERE plan_id = @clearPlan AND query_id = @clearQry
END;
PRINT ''- Cleared possibly affected plans in database [' + @userDB + ']''
END
ELSE
BEGIN
PRINT ''- No affected plans in database [' + @userDB + ']''
END
END
ELSE
BEGIN
PRINT ''- Query Store not enabled in database [' + @userDB + ']''
END')
UPDATE #tmpUserDBs
SET [IsDone] = 1
WHERE [database_id] = DB_ID(@userDB)
END
When you deploy an update to a hybrid environment (such as AlwaysOn, replication, cluster, and mirroring), we recommend that you refer to the following articles before you deploy the update:
-
SQL Server failover cluster rolling update and service pack process
Note If you do not want to use the rolling update process, follow these steps to apply an update:-
Install the update on the passive node.
-
Install the update on the active node (requires a service restart).
-
-
Upgrade and update of availability group servers that use minimal downtime and data loss
Note If you enabled AlwaysOn with SSISDB catalog, see the information about SSIS with AlwaysOn for more information about how to apply an update in these environments. -
How to apply a hotfix for SQL Server in a transactional replication and database mirroring topology
-
How to apply a hotfix for SQL Server in a replication topology
SQL Server Cumulative Updates are currently multilingual. Therefore, this cumulative update package is not specific to one language. It applies to all supported languages.
One Cumulative Update package includes all available updates for all SQL Server 2017 components (features). However, the cumulative update package updates only those components that are currently installed on the SQL Server instance you select to be serviced. If a SQL Server feature (for example, Analysis Services) is added to the instance after this CU is applied, you must re-apply this CU to update the new feature to this CU.
If additional issues occur or if any troubleshooting is required, you might have to create a service request. The usual support costs will apply to additional support questions and to issues that do not qualify for this specific cumulative update package. For a complete list of Microsoft Customer Service and Support telephone numbers, or to create a separate service request, go to the Microsoft Support website.
How to uninstall this update
-
In Control Panel, open the Programs and Features item, and then select View installed updates.
-
Locate the entry that corresponds to this cumulative update package under SQL Server 2017.
-
Press and hold (or right-click) the entry, and then select Uninstall.
To uninstall this CU on Linux, you must roll back the package to the previous version.
For more information about how to roll back the installation, see Rollback SQL Server.
Third-party information disclaimer
The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.
References
-
Announcing updates to the SQL Server Incremental Servicing Model (ISM)
-
SQL Server Service Packs are discontinued starting from SQL Server 2017
-
The script to determine which version and edition of SQL Server Database Engine is running
-
The Incremental Servicing Model for SQL Server to deliver hotfixes for reported problems
-
Naming schema for Microsoft SQL Server software update packages
-
Description of the standard terminology that is used to describe Microsoft software updates