HADR_AG_MUTEX 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?

Rarely. It is not a known contention point, because Availability Group configuration changes are infrequent. Get Wait Statistics does not filter it out, so if it ranks, you will see it.


What It Means

Microsoft’s definition: it occurs when an availability group DDL statement or Windows Server Failover Clustering command is waiting for exclusive read/write access to the configuration of an availability group. One configuration change at a time can hold it, so a second one waits here.


When It Does Matter

When an AG command hangs. Look for the other operation holding the configuration: another ALTER AVAILABILITY GROUP, a failover in progress, or automation issuing overlapping commands. sys.dm_exec_requests shows what else is running, and the cluster log covers cluster-initiated operations. Serialise your own automation, and let an in-flight failover finish before issuing more AG DDL. The baseline to monitor is how long your usual AG changes take.


The HADR Background Waits

These are the Availability Group background waits: timers, worker pools and cluster plumbing that tick over whether or not anything is wrong. For AG latency and lag, start from the main page, HADR_SYNC_COMMIT.

  • HADR_SYNC_COMMITSynchronous commit. The primary waiting for a synchronous secondary to harden the log, the AG wait that costs users time.The main page for this family
  • HADR_WORK_QUEUEIdle workers. AG background workers waiting for new work, the normal state of the pool.Usually noise
  • HADR_WORK_POOLWork pool access. Concurrency control on the AG background work task object.Usually noise
  • HADR_TIMER_TASKTimers. The lock on the AG timer object, plus the waits between runs of periodic AG tasks.Usually noise
  • HADR_NOTIFICATION_DEQUEUECluster notifications. A background task waiting for the next failover cluster notification.Usually noise
  • HADR_CLUSAPI_CALLCluster API calls. Switching to preemptive mode to call the Windows failover cluster APIs.Usually noise
  • HADR_AG_MUTEXAG configuration. AG DDL or a cluster command waiting for exclusive access to the AG configuration.Usually noise. This page.
  • HADR_FILESTREAM_IOMGR_IOCOMPLETIONFILESTREAM I/O manager. The AG FILESTREAM I/O manager waiting for I/O completion.Usually noise
  • HADR_ARCONTROLLER / FILESTREAM_IOMGRInternal locks. Short waits on the AG event subscriber list and the FILESTREAM I/O manager lock.Usually noise

Where To Go Next

HADR_AG_MUTEX is background noise on an Availability Group instance. 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 *