PRINT_ROLLBACK_PROGRESS

(Republishing, or using this info in a commercial product/website, is prohibited without permission. All other uses are permitted. If in doubt, please ask.)

(Back to main page…)

Description:

This wait type is when a thread is sleeping while waiting for transactions to finish rolling back after they’ve been killed because of this thread executing an ALTER DATABASE … WITH ROLLBACK IMMEDIATE or ROLLBACK AFTER… statement. The thread sleeps in a loop incurring this wait, with each wait being three seconds long.

(Books Online description: “Used to wait while user processes are ended in a database that has been transitioned by using the ALTER DATABASE termination clause. For more information, see ALTER DATABASE (Transact-SQL).”)

Questions/comments on this wait type? Click here to send Paul an email, especially if you have any information to add to this topic.

Added in SQL Server version:

Pre-2005/2005

Removed in SQL Server version:

N/A

Extended Events wait_type value:

The map_key value in sys.dm_xe_map_values is 233 in 2008 and 2008 R2, 240 in 2012, and 247 in 2014 RTM. After 2014 RTM, you must check the DMV to get the latest value as some map_key values have changed in later builds.

Other information:

The wait will accumulate while transactions are being rolled back, so the longer transactions take to roll back, the more accumulated wait time will accrue for this wait type. This could be because there are long-running transactions, which will naturally take a long time to roll back.

Anecdotal evidence is that this wait can also occur while trying to drop a database snapshot while there are many connections being made to the snapshot.

It could also be because an excessive number of VLFs (i.e. VLF fragmentation, many thousands of VLFs) are in the transaction log and that is causing the rollbacks to proceed slowly. Basically, the more VLFs there are, the longer it takes to search through the log for a particular VLF containing the next log record to roll back. You can investigate VLF fragmentation and learn more in my blog post here.

And it could also be because of general transaction log performance issues. See the WRITELOG wait type for more information.

Known occurrences in SQL Server (list number matches call stack list):

  1. Rolling back transactions because of an ALTER DATABASE to change a database option

Abbreviated call stacks (list number matches known occurrences list):

  1. SOS_Task::PostWait+9e
    SOS_Task::Sleep+149
    PrintRollBackProgress+71
    DBMgr::LockDBForStateChange+6fd
    DBMgr::ChangeDBState+f6b
    CStmtAlterDB::ChangeStateOption+25bf
    CStmtAlterDB::XretExecute+53b
    CMsqlExecContext::ExecuteStmts<0,1>+8bd
    CMsqlExecContext::FExecute+a48
    CSQLSource::Execute+86c
    process_request+a57
    process_commands+4a3
    SOS_Task::Param::Execute+21e
    SOS_Scheduler::RunTask+a8