REDO_THREAD_PENDING_WORK Wait Type in SQL Server

⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: HADR_SYNC_COMMIT Wait TypeRelated pillar: High Availability

Is It a Problem?

No. It is not a known contention point, expects high wait times on an AG generating very little log, and filters it as benign; Get Wait Statistics filters it out by default.


What It Means

Microsoft lists it as internal use only, from SQL Server 2012. It is a thread doing log redo on an Availability Group secondary waiting to be told there is more log to redo. A large total means the secondary was caught up.


When It Does Matter

It does not. The condition to watch on a secondary is the opposite: redo falling behind, which shows as a growing redo queue while this wait shrinks.

SELECT
    ar.replica_server_name,
    DB_NAME(drs.database_id) AS database_name,
    drs.synchronization_state_desc,
    drs.log_send_queue_size,
    drs.log_send_rate,
    drs.redo_queue_size,
    drs.redo_rate
FROM sys.dm_hadr_database_replica_states AS drs
JOIN sys.availability_replicas AS ar ON ar.replica_id = drs.replica_id
ORDER BY drs.log_send_queue_size DESC;

The baseline to monitor is redo_queue_size draining after bursts. The query needs VIEW SERVER STATE.


The HADR Secondary Replica Waits

These are the Availability Group waits around redo on a secondary, readable secondaries in particular, and the asynchronous work tasks behind AG operations. For AG latency, start from the main page, HADR_SYNC_COMMIT.

  • HADR_SYNC_COMMITSynchronous commit. The primary waiting for a synchronous secondary to harden the log.The main page for this family
  • DIRTY_PAGE_TABLE_LOCKDirty page table. Redo and read queries on a readable secondary contending for the list of dirty pages.Worth investigating
  • DPT_ENTRY_LOCKDirty page entries. The same contention when redo and reads want the same pages.Worth a look when it climbs
  • REDO_THREAD_PENDING_WORKRedo idle. A redo thread on a secondary waiting to be told there is more log to redo.Usually noise. This page.
  • PWAIT_HADR_WORKITEM_COMPLETEDAG operations. Waiting for an asynchronous AG work task to complete.Worth a look when it climbs

Where To Go Next

REDO_THREAD_PENDING_WORK is background noise on an Availability Group secondary. If you are chasing a real problem, start with the waits that cost you time.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *