You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/database-engine/availability-groups/windows/availability-modes-always-on-availability-groups.md
+14-18Lines changed: 14 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,10 +46,9 @@ If the current primary is configured for asynchronous commit availability mode,
46
46
47
47
The following illustration shows an availability group with five availability replicas. The primary replica and one secondary replica are configured for synchronous-commit mode with automatic failover. Another secondary replica is configured for synchronous-commit mode with only planned manual failover, and two secondary replicas are configured for asynchronous-commit mode, which supports only forced manual failover (typically called *forced failover*).
48
48
49
-
50
49

51
50
52
-
The synchronization and failover behavior between two availability replicas depends on the availability mode of both replicas. For example, for synchronous commit to occur, both the current primary replica and the secondary replica in question must be configured for synchronous commit. Likewise, for automatic failover to occur, both replicas need to be configured for automatic failover. Therefore, the behavior for the illustrated deployment scenario above can be summarized in the following table, which explores the behavior with each potential primary replica:
51
+
The synchronization and failover behavior between two availability replicas depend on the availability mode of both replicas. For example, for synchronous commit to occur, both the primary replica and the secondary replica must be configured for synchronous commit. Likewise for automatic failover, both replicas need to be configured for automatic failover. Therefore, the behavior for the illustrated deployment scenario above can be summarized in the following table, which explores the behavior with each potential primary replica:
@@ -109,30 +108,27 @@ If the current primary is configured for asynchronous commit availability mode,
109
108
110
109
> [!TIP]
111
110
> To view the synchronization health of an availability group, availability replica, or availability database, query the **synchronization_health** or **synchronization_health_desc** column of [sys.dm_hadr_availability_group_states](../../../relational-databases/system-dynamic-management-views/sys-dm-hadr-availability-group-states-transact-sql.md), [sys.dm_hadr_availability_replica_states](../../../relational-databases/system-dynamic-management-views/sys-dm-hadr-availability-replica-states-transact-sql.md), or [sys.dm_hadr_database_replica_states](../../../relational-databases/system-dynamic-management-views/sys-dm-hadr-database-replica-states-transact-sql.md), respectively.
112
-
113
-
111
+
114
112
### <aname="HowSyncWorks"></a> How Synchronization Works on a Secondary Replica
115
113
116
-
Under the synchronous-commit mode, after a secondary replica joins the availability group and establishes a session with the primary replica, the secondary replica writes incoming log records to disk (*hardens the log*) and sends a confirmation message to the primary replica. Once the hardened log on the secondary database has caught up the end of log on the primary database, the state of the secondary database is set to SYNCHRONIZED. The time required for synchronization depends essentially on how far the secondary database was behind the primary database at the start of the session (measured by the number of log records initially received from the primary replica), the work load on the primary database, and the speed of the computer of the server instance that hosts the secondary replica.
114
+
In synchronous-commit mode, after a secondary replica joins the availability group and establishes a session with the primary replica:
117
115
118
-
119
-
Synchronous operation is maintained in the following manner:
120
-
121
-
1.
122
-
On receiving a transaction from a client, the primary replica writes the log for the transaction to the transaction log and concurrently sends the log record to the secondary replicas.
116
+
1. The secondary replica writes incoming log records to disk (*hardens the log*).
117
+
1. The secondary replica sends a confirmation message to the primary replica.
123
118
124
-
125
-
2.
126
-
Once a log record is written to the transaction log of the primary database, the transaction can be undone only if there is a failover at this point to a secondary that did not receive the log. The primary replica waits for confirmation from the synchronous-commit secondary replica.
119
+
After the hardened log on the secondary database has caught up to the end of log on the primary database, the state of the secondary database is set to SYNCHRONIZED.
127
120
121
+
The time required for synchronization depends on how far the secondary database was behind the primary database at the start of the session. This delta is measured by the number of log records initially received from the primary replica, the work load on the primary database, and the speed of the instance host of the secondary replica.
128
122
129
-
3.
130
-
The secondary replica hardens the log and returns an acknowledgment to the primary replica.
131
-
123
+
Synchronous operation is maintained in the following manner:
132
124
133
-
4.
134
-
On receiving the confirmation from the secondary replica, the primary replica finishes the commit processing and sends a confirmation message to the client.
125
+
1. On receiving a transaction from a client, the primary replica writes the log for the transaction to the transaction log and concurrently sends the log record to the secondary replicas.
126
+
127
+
2. Once a log record is written to the transaction log of the primary database, the transaction can be undone only if there is a failover at this point to a secondary that did not receive the log. The primary replica waits for confirmation from the synchronous-commit secondary replica.
128
+
129
+
3. The secondary replica hardens the log and returns an acknowledgment to the primary replica.
135
130
131
+
4. On receiving the confirmation from the secondary replica, the primary replica finishes the commit processing and sends a confirmation message to the client.
0 commit comments