KB5036432: Cumulative update for SQL Server 2022, CU branch, May 2024. Availability-group patch failure can recover; SESSION_CONTEXT issue remains
CU13 includes 15 fixes, including fixes for availability groups and replication. Setup might initially fail on some availability-group databases, while parallel SESSION_CONTEXT queries can still return incorrect results or cause access violations.
Does it affect you? Applies to: Instances running SQL Server 2022. The package updates only SQL Server components that are already installed on the instance.
Review notes Additional details from the official release notes (2) Read notes
- Known issues Microsoft says this issue is fixed in SQL Server 2022 CU16. After an initial Setup failure, startup can also complete the patch scripts without user action.
- What changes The Service Broker conversation-timer fix is listed for Windows only.
The official sources are linked at the end of the page.
For servers on the CU branch: they install cumulative updates, which also bring fixes beyond security. Servers on the GDR branch (security fixes only) get a separate update. Which branch am I on?
What changes
Fixes 11 changes
High Availability and Disaster Recovery
-
Secondary availability-group databases are less likely to fail to come online intermittently.1
Fixes startup failures that could produce error 3602 on secondary databases.
-
Read-scale availability groups without a cluster configuration no longer encounter a specified assertion failure.2
Fixes the assertion at
HadrArProxy.cpp:4314when using read-scale availability groups without a cluster configuration.
Metadata
-
Secondary replicas are less likely to encounter random access violations and dump files in the described processor configuration.3
Fixes an issue when the primary replica has 16 or more processors and secondary replicas have fewer than 16.
-
Fetching the next value for a sequence object no longer encounters the described latch time-out.4
Fixes a self-deadlock during lock escalation.
Query Execution
-
Converting a string representing negative zero to a decimal or numeric value no longer leads to an out-of-range value reported by database checks.5
Fixes the issue involving
INSERTwithCASTorCONVERT; the out-of-range value was reported byDBCC CHECKDBandDBCC CHECKTABLE.
Replication
-
Change data capture can be disabled when a column is encrypted with Always Encrypted.6
Fixes the inability to disable change data capture if any column is encrypted by Always Encrypted.
-
CDC is less likely to miss changes when it runs at the same time as a partition switch operation.7
Fixes missing changes in CDC change tables when CDC runs in parallel with a switch partition operation.
-
Running the on-demand change-tracking cleanup procedure no longer produces the listed variable-declaration errors on a case-sensitive instance.8
Fixes errors from
sys.sp_flush_CT_internal_table_on_demandon instances using the case-sensitive (_CS) collation option. -
Service Broker conversation timers are less likely to cause query failures or leave the instance unresponsive under memory pressure.9
Fixes an error when using conversation timers while the SQL Server instance is under memory pressure.
Search
For: SQL Server users of full-text search
- The full-text auto crawl function is less likely to stop working during full-text searches.10
Security Infrastructure
For: SQL Server users of linked servers and dynamic data masking
-
Updating a view that uses a linked server no longer encounters the listed unsupported-query error when dynamic data masking is enabled.11
Fixes error 15905 when updating a view with a linked server connection to another instance and dynamic data masking enabled.
Improvements 3 changes
Query Optimizer
For: SQL Server users creating statistics on temporary tables
-
Creating statistics on temporary tables can involve fewer registry waits.12
Caches the maximum number of histogram steps in a global configuration variable to reduce
PREEMPTIVE_OS_REGISTRYwaits.
Replication
For: SQL Server administrators using change tracking
-
The change-tracking history records an error message to help explain cleanup failures.13
Adds the error message to the
commentscolumn ofdbo.MSchange_tracking_historywhen automatic or manual cleanup fails.
SQL OS
-
A warning is logged when high I/O latency in Bufferpool Lazy Writer could affect scheduler fairness.14
Adds a log message for high I/O latencies in Bufferpool Lazy Writer (
ntdll!ZwWriteFile) when an asynchronous API invocation exceeds the expected time.
New feature 1 change
Query Execution
-
A new advanced option lets you limit memory used to handle remote procedure call parameters.15
Adds the
'max RPC request params (KB)'option, configured by usingsp_configure.
Known issues
-
Incorrect behavior of SESSION_CONTEXT in parallel plans
Queries using
SESSION_CONTEXTmight return incorrect results or trigger access violation dump files when run in parallel query plans, particularly if the session is reset for reuse.16Workaround status No workaround yetMicrosoft has not published a manual workaround for this issue yet. Monitor release health until a resolving update is available.
-
Issue three: Patching error for secondary replicas in an availability group with databases enabled replication or CDC
When patching an availability group with a database enabled for replication or CDC, or with SSISDB, Setup might report an initial failure because the database cannot be accessed in single-user mode. SQL Server then starts without single-user mode, completes the patch scripts, and resolves the issue without user action.17
How to apply the workaround SQL Trace FlagTo prevent the initial failure, enable Trace Flag 12347 before patching and remove it afterward, or remove the replication or CDC database from the availability group or remove replication or CDC from the database.17
Step-by-step workaround instructionsShow steps Hide steps2 stepsStep-by-step procedure- Before patching, enable Trace Flag 12347 and remove it after patching.
- Alternatively, before patching, drop the CDC- or replication-enabled database from the availability group, or remove CDC or replication from the database.
Technical details
Data sheet · Security · Downloads · Components Click to collapse or expand
Data sheet
- Released
- 2024-05-16
- Classification
- Updates
- Type
- Cumulative update
- Servicing branch
- CU
- Restart
- Required
- Replaces
- KB5033663, KB5032679
- Replaced by
- KB5040939
| Version | Build | Channel |
|---|---|---|
| 2022 | 16.0.4125.3 | General availability |
Security
No vulnerabilities are listed for this update.
Downloads (Microsoft Update Catalog)
Sources
Cited passages from Microsoft's official notes (17)
-
1.
Fixes an issue in which the secondary databases of an availability group might fail to be online intermittently. Additionally, you see the following error message: Database 'DatabaseName' (database ID <IDNumber>) startup failed with error 3602, severity 25, state 145.
support.microsoft.com -
2.
Fixes an assertion failure (Location: HadrArProxy.cpp:4314; Expression: !CFeatureSwitchesMin::GetCurrentInstance()->FHadrCheckXClusterAgUcsSizeEnabled() || cbBlob < x_cbMsgBodyMax) that you might encounter when you use read-scale availability groups without a cluster configuration.
support.microsoft.com -
3.
Fixes an issue in the lock manager that might cause random access violations and dumps on secondary replicas when the primary replica has 16 or more processors, and the secondary replicas have less than 16 processors.
support.microsoft.com -
4.
Fixes a latch time-out issue that you encounter when fetching the next value for sequence objects, which is due to self-deadlock during lock escalation.
support.microsoft.com -
5.
Fixes an issue in which using the INSERT statement with the CAST or CONVERT function from a string representing negative zero to a decimal or numeric datatype succeeds, but you see the following error message on DBCC CHECKDB and DBCC CHECKTABLE:
support.microsoft.com -
6.
FIX: Can't disable "change data capture" if any column is encrypted by "Always Encrypted" feature in SQL Server (KB4034376)
support.microsoft.com -
7.
Fixes an issue in which some changes might not be captured into the change data capture (CDC) change tables (cdc.<capture_instance>_CT) when CDC runs in parallel with a switch partition operation.
support.microsoft.com -
8.
Fixes the following error that you encounter when running sys.sp_flush_CT_internal_table_on_demand in a SQL Server instance that has the Case-sensitive (_CS) collation option:
support.microsoft.com -
9.
Fixes an error that you encounter when using conversation timers in Service Broker while the SQL Server instance is under memory pressure. This causes queries to fail and the instance to stop responding.
support.microsoft.com -
10.
Fixes an issue in which the full-text auto crawl function might stop working when you use full-text search.
support.microsoft.com -
11.
Fixes the following error that you encounter when updating a view with a linked server connection to another instance if dynamic data masking (DDM) is enabled:
support.microsoft.com -
12.
Caches the maximum number of histogram steps in a global configuration variable to reduce PREEMPTIVE_OS_REGISTRY waits when creating statistics on temporary tables.
support.microsoft.com -
13.
Adds the error message to the comments column of dbo.MSchange_tracking_history to help you understand the failure if a failure occurs during the auto cleanup or manual cleanup process.
support.microsoft.com -
14.
Adds the following log message when high I/O latencies are detected in Bufferpool Lazy Writer (
support.microsoft.comntdll!ZwWriteFilesystem call) due to a performance issue in the underlying storage: -
15.
Adds a new advanced option 'max RPC request params (KB)' configured by using sp_configure to limit the maximum memory allocated for handling remote procedure call (RPC) request parameters.
support.microsoft.com -
16.
Queries that use the built-in
support.microsoft.comSESSION_CONTEXTfunction might return incorrect results or trigger access violation (AV) dump files when run in parallel query plans. -
17.
At that time, the patch upgrade scripts finish successfully and patching is complete. Once startup completes, the issue is resolved and no user action is required.
support.microsoft.com
Checked automatically: 8 of 8 checks passed, 17 quoted passages · compared with Microsoft's page on Oct 20, 2026
- Quotes found in the official pages: passed
- Numbers found in the sources: passed
- Vulnerabilities from the dossier only: passed
- Links to allowed domains only: passed
- Every official change covered: passed
- Readable plain text: passed
- Changes confirmed by the file list: passed
- Sources agree: passed
A second AI read the text against the sources: correctness 4/5, clarity 4/5, completeness 4/5. How we work
Published by The Update Bureau. Written with AI from Microsoft's own documents, checked by rules and a second AI. How we work · Report a mistake