HADR_SYNC_COMMIT

This is an availability group-specific wait that occurs as a result of synchronous replication.

In synchronous-commit mode, the primary replica doesn't commit any transactions until it receives acknowledgement that all synchronous secondary replicas have finished hardening the commit in their log. The HADR_SYNC_COMMIT wait type reflects the time taken for the primary replica to send log records to the secondary, and for the secondary replica to receive these records, harden them, and send back acknowledgement to the primary replica.

This wait doesn't include the time taken to redo log records on the secondary replica.

Once the secondary replica has sent back acknowledgement to the primary, and once the log send queue on the primary replica is empty, the secondary replica's state transitions from Synchronizing to Synchronized. The HADR_SYNCHRONIZING_THROTTLE wait type measures the time taken for this transition.

Investigating

Check the following metrics on the Analysis page to find out whether there’s a general problem with your environment. See each metric’s Description tab for guideline values and possible solutions.

  • Flow control time
    Flow control can restrict the rate at which log records are sent from the primary to the secondary. A high value for flow control time, and consequently a low rate of log bytes sent, will therefore contribute to the HADR_SYNC_COMMIT wait.
  • Log bytes flushed/sec (Log growth on the Availability group overview), log send queue, and log bytes received/sec (Received rate on the Availability group overview).
    If the rate of log bytes flushed on the primary replica is higher than the rate at which the log records are sent, this will cause the log send queue to grow, adding to the HADR_SYNC_COMMIT wait.
    If the rate of log bytes received is high but the rate of log bytes flushed on the secondary replica is low, this indicates that the data is arriving faster than it can be flushed to the secondary database log, causing a bottleneck and adding to the HADR_SYNC_COMMIT wait.

    The Log growth metric on the availability group overview represents the rate of log bytes flushed on the primary replica only, even when it's displayed alongside a database on a secondary replica.

    To see the rate of log bytes flushed for a database on a secondary replica, go to the Analysis Graph, select the metric Log bytes flushed/sec, and then select the database.

  • Transaction delay
    Transaction delay is the same measure as HADR_SYNC_COMMIT, but on a per-database level.

Do you have any feedback on this documentation?

Let us know at sqlmonitorfeedback@red-gate.com


Didn't find what you were looking for?