Operational Defect Database

BugZero found this defect 910 days ago.

Microsoft SQL Server | 14422835

KB5008296 - FIX: Missing change data capture cleanup execution isn't identified because of a deadlock without an error message - Microsoft Support

Last update date:

3/30/2022

Affected products:

SQL Server 2019 on Windows

SQL Server 2017 on Windows

Affected releases:

build lower than 14.0.3436.1

Fixed releases:

14.0.3436.1

Description:

Symptoms

Consider the following scenario: You use sp_cdc_cleanup_change_table to manage the change table cleanup process. A deadlock occurs between the change data capture (CDC) scan and CDC cleanup when sp_cdc_cleanup_change_table is invoked. In this scenario, the following error 22852 with severity 10 (informational message) occurs: Could not delete change table entries made obsolete by a change in one or more low water marks for capture instances of database <DatabaseName>. The failure occurred when executing the command <CommandName>. The error returned was <ErrorInfo>. Use the action and error to determine the cause of the failure and resubmit the request. Note Because this is an informational message, the cleanup process doesn't fail, and there's no way to determine whether the cleanup succeeds or fails.

Details about the fix

To determine whether the cleanup succeeds or fails when you use sp_cdc_cleanup_change_table, an optional output parameter (fCleanupFailed bit) is added to sp_cdc_cleanup_change_table function. This can be used to check whether the cleanup of any capture instances fails. If fCleanupFailed output is 0, all the cleanup succeeds. If it is 1, at least the cleanup of one capture instance fails. Here is an example: -- Declaring a variable and Setting to zero first  select @cleanup_failed_bit = 0 --Execute cleanup and obtain output bit EXEC @retcode =sys.sp_cdc_cleanup_change_table @capture_instance = '<CaptureInstance>', @low_water_mark = @LSN, @threshold = 1 , @fCleanupFailed = @cleanup_failed_bit output       --Leverage @cleanup_failed_bit output to check the status.

Resolution

This problem is fixed in the following cumulative updates for SQL Server: Cumulative Update 14 for SQL Server 2019 Cumulative Update 29 for SQL Server 2017 About cumulative updates for SQL Server Each new cumulative update for SQL Server contains all the hotfixes and security fixes that were in the previous build. We recommend that you install the latest build for your version of SQL Server: Latest cumulative update for SQL Server 2019 Latest cumulative update for SQL Server 2017

Status

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

References

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

Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Unavailable

Learn More

Search:

...