Skip to content

Commit 6c72401

Browse files
authored
Merge pull request #23221 from WilliamDAssafMSFT/20220714-adr-supportability
20220714 adr pvs supportability
2 parents 89c344d + 8683586 commit 6c72401

3 files changed

Lines changed: 44 additions & 29 deletions

File tree

docs/relational-databases/accelerated-database-recovery-concepts.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Accelerated database recovery"
33
title: "Accelerated database recovery"
4-
ms.date: "05/24/2022"
4+
ms.date: 07/14/2022
55
ms.prod: sql
66
ms.prod_service: backup-restore
77
ms.technology: backup-restore
@@ -83,8 +83,8 @@ The ADR recovery process has the same three phases as the current recovery proce
8383

8484
- **Redo** phase
8585

86-
Broken into two sub-phases
87-
- Sub-phase 1
86+
Broken into two subphases
87+
- Subphase 1
8888

8989
Redo from SLOG (oldest uncommitted transaction up to last checkpoint). Redo is a fast operation as it only needs to process a few records from the SLOG.
9090

@@ -156,10 +156,11 @@ There are several improvements to address persistent version store (PVS) storage
156156

157157
- **Multi-threaded version cleanup**
158158

159-
In [!INCLUDE[sssql19-md](../includes/sssql19-md.md)], the cleanup process is single threaded within a SQL Server instance. In SQL Server 2022 (16.x) Preview, the cleanup process has multiple threads, with one thread per SQL Server database.
159+
In [!INCLUDE[sssql19-md](../includes/sssql19-md.md)], the cleanup process is single threaded within a SQL Server instance.
160160

161-
In [!INCLUDE[sssql22-md](../includes/sssql22-md.md)], CTP 2.0, you can also enable multi-threaded version cleanup at the database level with trace flag 3515. This allows multiple threads for cleanup per database. This improvement is valuable when you have a fewer number of large databases.
162-
To enable trace flag 3515 for the instance, run the following command:
161+
In [!INCLUDE[sssql22-md](../includes/sssql22-md.md)], CTP 2.0, you can also enable multi-threaded version cleanup at the database level with trace flag 3515. This allows multiple threads for cleanup per database. This improvement is valuable when you have multiple large databases.
162+
163+
To enable trace flag 3515 for the instance, run the following command:
163164

164165
```sql
165166
DBCC TRACEON(3515, -1)
@@ -175,6 +176,10 @@ To enable trace flag 3515 for the instance, run the following command:
175176
RECONFIGURE WITH OVERRIDE;
176177
```
177178

179+
- **New extended event**
180+
181+
A new extended event, `tx_mtvc2_sweep_stats`, has been added for telemetry on the ADR PVS multi-threaded version cleaner.
182+
178183
## Best practices and guidance
179184

180185
For guidance on workloads that are and are not recommended for ADR, see [Manage accelerated database recovery](accelerated-database-recovery-management.md).

docs/relational-databases/accelerated-database-recovery-troubleshoot.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Troubleshoot accelerated database recovery"
33
title: "Troubleshoot accelerated database recovery"
4-
ms.date: 07/12/2022
4+
ms.date: 07/14/2022
55
ms.prod: sql
66
ms.prod_service: backup-restore
77
ms.technology: backup-restore
@@ -23,7 +23,9 @@ This article helps administrators diagnose issues with accelerated database reco
2323

2424
## Examine the persistent version store (PVS)
2525

26-
Leverage the `sys.dm_tran_persistent_version_store_stats` DMV to identify if the size of the accelerated database recovery (ADR) PVS is growing larger than expected, and then to determine which factor is preventing persistent version store (PVS) cleanup.
26+
Leverage the [sys.dm_tran_persistent_version_store_stats](system-dynamic-management-views/sys-dm-tran-persistent-version-store-stats.md) DMV to identify if the size of the accelerated database recovery (ADR) PVS is growing larger than expected, and then to determine which factor is preventing persistent version store (PVS) cleanup.
27+
28+
Included in the following sample script is the column `sys.dm_tran_persistent_version_store_stats.pvs_off_row_page_skipped_oldest_aborted_xdesid`, which was added in [!INCLUDE[sssql22-md](../includes/sssql22-md.md)] and contains the number of pages skipped for reclaim due to oldest aborted transactions. If the version cleaner is slow or invalidated, this will reflect how many pages must be kept for aborted transactions.
2729

2830
The sample query shows all information about the cleanup processes and shows the current PVS size, oldest aborted transaction, and other details:
2931

@@ -41,7 +43,8 @@ SELECT
4143
asdt.session_id AS active_transaction_session_id,
4244
asdt.elapsed_time_seconds AS active_transaction_elapsed_time_seconds,
4345
pvss.pvs_off_row_page_skipped_low_water_mark,
44-
pvss.pvs_off_row_page_skipped_min_useful_xts
46+
pvss.pvs_off_row_page_skipped_min_useful_xts,
47+
pvss.pvs_off_row_page_skipped_oldest_aborted_xdesid -- SQL Server 2022 only
4548
FROM sys.dm_tran_persistent_version_store_stats AS pvss
4649
CROSS APPLY (SELECT SUM(size*8.) AS total_db_size_kb FROM sys.database_files WHERE [state] = 0 and [type] = 0 ) AS df
4750
LEFT JOIN sys.dm_tran_database_transactions AS dt
@@ -148,13 +151,19 @@ For example,
148151
EXEC sys.sp_persistent_version_cleanup [WideWorldImporters];
149152
```
150153
154+
## Use trace flags to capture cleanup failures
155+
156+
*Applies to [!INCLUDE[sql-server-2022](../includes/sssql22-md.md)] and later*
157+
158+
Trace flag 4025 can be enabled to record ADR PVS cleanup behavior in the SQL Server error log. Typically this would result in a new log event recorded every 10 minutes. For more information, see [DBCC TRACEON (Transact-SQL)](../t-sql/database-console-commands/dbcc-traceon-transact-sql.md).
159+
151160
## See also
152161
153162
- [sys.sp_persistent_version_cleanup](system-stored-procedures/sys-sp-persistent-version-cleanup-transact-sql.md)
154163
- [sys.dm_tran_persistent_version_store_stats](system-dynamic-management-views/sys-dm-tran-persistent-version-store-stats.md)
155164
- [sys.dm_tran_aborted_transactions](system-dynamic-management-views/sys-dm-tran-aborted-transactions.md)
156165
157-
## Next steps
166+
## Next steps
158167
159168
- [Accelerated database recovery concepts](accelerated-database-recovery-concepts.md)
160169
- [Manage accelerated database recovery](accelerated-database-recovery-management.md)

0 commit comments

Comments
 (0)