How to fix Error 3907 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 3907 – Persistent Version Store Row Version Not Found

Why This Error Happens

This error occurs when SQL Server 2025’s Accelerated Database Recovery (ADR) feature cannot locate a required row version in the Persistent Version Store (PVS) because it has been prematurely cleaned up or the PVS has run out of allocated space. This typically happens due to long-running transactions holding open snapshots while aggressive version cleanup occurs, or because the database file growth settings cannot keep pace with the version store’s storage demands. In some cases, this is also triggered by a corrupted or inconsistent PVS internal table structure following an unexpected shutdown.

Step-by-Step Resolution Guide

Step 1: Check Persistent Version Store Space Usage

  • Open SQL Server Management Studio (SSMS) and run the following query to inspect PVS consumption:
  SELECT * FROM sys.dm_tran_persistent_version_store_stats;
  • Check the persistent_version_store_size_kb column against available database free space.
  • Verify database autogrowth settings via Database Properties > Files in SSMS are not set to a restrictive fixed growth increment.

Step 2: Identify and Kill Long-Running Transactions

  • Run the following to find blocking or long-running sessions preventing PVS cleanup:
  SELECT * FROM sys.dm_tran_active_snapshot_database_transactions;
  • Cross-reference the transaction_sequence_num with active sessions using sys.dm_exec_sessions.
  • Terminate problematic sessions using KILL <session_id>; once confirmed safe to do so.

Step 3: Increase Database File Space and Autogrowth Limits

  • Navigate to Databases > [Your DB] > Properties > Files in SSMS.
  • Manually expand the primary data file or add a secondary data file on a drive with sufficient free space (minimum 20% headroom recommended).
  • Update autogrowth to a fixed MB value (e.g., 512MB) rather than a percentage to avoid unpredictable growth spikes.

Step 4: Disable and Re-enable Accelerated Database Recovery

  • Run the following T-SQL command to disable ADR temporarily:
  ALTER DATABASE [YourDatabaseName] SET ACCELERATED_DATABASE_RECOVERY = OFF;
  • Wait for the PVS cleanup background thread to fully purge, then re-enable it:
  ALTER DATABASE [YourDatabaseName] SET ACCELERATED_DATABASE_RECOVERY = ON;
  • This forces a rebuild of the version store metadata, resolving any internal corruption pointers.

Step 5: Review SQL Server Error Logs for Disk I/O Conflicts

  • Open C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG (adjust version path as needed for SQL Server 2025).
  • Search for associated I/O warnings or “stalled” write messages near the timestamp of the 3907 error.
  • Confirm the underlying storage (especially on Windows Server 2025 with ReFS volumes) is not experiencing latency or fragmentation issues.

Alternative or Verification Steps

  • Verify the fix by re-running the original query/transaction that triggered Error 3907 and confirming it completes without aborting.
  • If the issue persists, run DBCC CHECKDB on the affected database to rule out underlying corruption, and consider restoring from the last known good backup if PVS metadata remains inconsistent.