Synchronous Replicas Data Synchronization monitor

Microsoft.SQLServer.2016.AlwaysOn.AvailabilityReplicasSynchronizationState (UnitMonitor)

Synchronous Replicas Data Synchronization

Knowledge Base article:

Summary

This monitor rolls up the data synchronization state of all availability replicas and checks whether any availability replica is not in the expected synchronization state. The monitor is unhealthy when any asynchronous replica is not in SYNCHRONIZING state and any synchronous replica is not in SYNCHRONIZED state. The monitor state is healthy otherwise.

Causes

In this availability group, at least one synchronous replica is not currently synchronized. The replica synchronization state could be either SYNCHRONIZING or NOT SYNCHRONIZING.

Resolutions

Find the availability replica with incorrect synchronization state using availability replica monitor state and resolve the issue at the availability replica.

Overrideable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow.

Yes

Generates Alerts

Defines whether the workflow generates an Alert.

No

Interval (seconds)

The recurring interval of time in seconds in which to run the workflow.

900

Timeout (seconds)

Specifies the time the workflow is allowed to run before being closed and marked as failed.

300

Element properties:

TargetMicrosoft.SQLServer.2016.AlwaysOn.AvailabilityGroupHealth
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateFalse
Alert Auto ResolveFalse
Monitor TypeMicrosoft.SQLServer.2016.AlwaysOn.SystemPolicyScriptMonitorType
RemotableTrue
AccessibilityPublic
RunAsMicrosoft.SQLServer.MonitoringAccount

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2016.AlwaysOn.AvailabilityReplicasSynchronizationState" RunAs="GPMP!Microsoft.SQLServer.MonitoringAccount" TypeID="Microsoft.SQLServer.2016.AlwaysOn.SystemPolicyScriptMonitorType" Accessibility="Public" Enabled="true" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Target="AlwaysOnDisc!Microsoft.SQLServer.2016.AlwaysOn.AvailabilityGroupHealth" Priority="Normal">
<Category>AvailabilityHealth</Category>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="HealthState" HealthState="Success"/>
<OperationalState ID="Critical" MonitorTypeStateID="ErrorState" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<Interval>900</Interval>
<TimeoutSeconds>300</TimeoutSeconds>
<PolicyName>$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2016.AlwaysOn.AvailabilityGroupHealth"]/AvailabilityGroupName$-AlwaysOnAgSynchronousReplicasDataSynchronizationHealthPolicy</PolicyName>
<InstanceName>$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2016.AlwaysOn.AvailabilityGroupHealth"]/InstanceName$</InstanceName>
</Configuration>
</UnitMonitor>