Define two measurements: the SQL Server role transition and the client-visible outage. Extended Events and error logs show replica and database state changes, while a listener probe measures when the application can successfully connect and complete work again.
Last updated: October 14, 2026.
SELECT
SYSUTCDATETIME() AS observed_at,
ag.name AS availability_group,
ar.replica_server_name,
ars.role_desc,
DB_NAME(drs.database_id) AS database_name,
drs.synchronization_state_desc,
drs.database_state_desc
FROM sys.availability_groups AS ag
JOIN sys.availability_replicas AS ar
ON ar.group_id = ag.group_id
JOIN sys.dm_hadr_availability_replica_states AS ars
ON ars.replica_id = ar.replica_id
JOIN sys.dm_hadr_database_replica_states AS drs
ON drs.replica_id = ar.replica_id
WHERE ars.is_local = 1;This snapshot confirms the local replica role and database state at one instant. Polling it can support a lab test, but Extended Events provide a better record of the transition and a client probe is required for end-to-end recovery time.
Capture the server-side transition
Microsoft documents the built-in alwayson_health Extended Events session, including replica state changes and error 1480 for a database replica role change. Confirm that the session runs on every replica and retains enough event files for the test window.
For a planned failover, record the UTC time when the command is issued and the event timestamps showing the target replica becoming primary and each database becoming online. Keep clocks synchronized across replicas and the probe host.
Measure what the application experiences
Run a bounded probe through the Availability Group listener from the same network path as the application. Record the last successful operation before failover and the first successful connection plus lightweight read or write afterward. That interval includes listener resolution, driver retry behavior, database recovery, and reconnect time.
Repeat planned tests under representative load and report a distribution rather than one best result. Record the failover type, synchronization state, database count, transaction workload, driver settings, and whether connection strings use the listener and MultiSubnetFailover where appropriate.
Microsoft explains that the failover target must take the primary role, recover databases, and bring them online in its failover-mode documentation. Report server transition time and application outage separately so driver delays are not blamed on SQL Server recovery.
Continue with SESSION_TIMEOUT behavior, distributed AG page repair, and bounded JDBC timeouts.