Skip to content

Commit 82942bc

Browse files
authored
Merge pull request #133960 from ajlam/gtid
GTID for MySQL
2 parents 00ba262 + 9cd33ea commit 82942bc

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

articles/mysql/concepts-read-replicas.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,26 @@ Once you have decided you want to failover to a replica,
123123

124124
Once your application is successfully processing reads and writes, you have completed the failover. The amount of downtime your application experiences will depend on when you detect an issue and complete steps 1 and 2 above.
125125

126+
## Global transaction identifier (GTID)
127+
128+
Global transaction identifier (GTID) is a unique identifier created with each committed transaction on a source server and is OFF by default in Azure Database for MySQL. GTID is supported on versions 5.7 and 8.0 and only on servers that support storage up to 16 TB. To learn more about GTID and how it's used in replication, refer to MySQL's [replication with GTID](https://dev.mysql.com/doc/refman/5.7/en/replication-gtids.html) documentation.
129+
130+
MySQL supports two types of transactions: GTID transactions (identified with GTID) and anonymous transactions (don't have a GTID allocated)
131+
132+
The following server parameters are available for configuring GTID:
133+
134+
|**Server parameter**|**Description**|**Default Value**|**Values**|
135+
|--|--|--|--|
136+
|`gtid_mode`|Indicates if GTIDs are used to identify transactions. Changes between modes can only be done one step at a time in ascending order (ex. `OFF` -> `OFF_PERMISSIVE` -> `ON_PERMISSIVE` -> `ON`)|`OFF`|`OFF`: Both new and replication transactions must be anonymous <br> `OFF_PERMISSIVE`: New transactions are anonymous. Replicated transactions can either be anonymous or GTID transactions. <br> `ON_PERMISSIVE`: New transactions are GTID transactions. Replicated transactions can either be anonymous or GTID transactions. <br> `ON`: Both new and replicated transactions must be GTID transactions.|
137+
|`enforce_gtid_consistency`|Enforces GTID consistency by allowing execution of only those statements that can be logged in a transactionally safe manner. This value must be set to `ON` before enabling GTID replication. |`OFF`|`OFF`: All transactions are allowed to violate GTID consistency. <br> `ON`: No transaction is allowed to violate GTID consistency. <br> `WARN`: All transactions are allowed to violate GTID consistency, but a warning is generated. |
138+
139+
> [!NOTE]
140+
> Once GTID is enabled, you cannot turn it back off. If you need to turn GTID OFF, please contact support.
141+
142+
To enable GTID and configure the consistency behavior, update the `gtid_mode` and `enforce_gtid_consistency` server parameters using the [Azure portal](howto-server-parameters.md), [Azure CLI](howto-configure-server-parameters-using-cli.md), or [PowerShell](howto-configure-server-parameters-using-powershell.md).
143+
144+
If GTID is enabled on a source server (`gtid_mode` = ON), newly created replicas will also have GTID enabled and use GTID replication. To keep replication consistent, you cannot update `gtid_mode` on the source or replica server(s).
145+
126146
## Considerations and limitations
127147

128148
### Pricing tiers
@@ -173,9 +193,18 @@ The [`event_scheduler`](https://dev.mysql.com/doc/refman/5.7/en/server-system-va
173193

174194
To update one of the above parameters on the source server, please delete replica servers, update the parameter value on the master, and recreate replicas.
175195

196+
### GTID
197+
198+
GTID is supported on:
199+
- MySQL versions 5.7 and 8.0
200+
- Servers that support storage up to 16 TB. Refer to the [pricing tier](concepts-pricing-tiers.md#storage) article for the full list of regions that support 16 TB storage.
201+
202+
GTID is OFF by default. Once GTID is enabled, you cannot turn it back off. If you need to turn GTID OFF, please contact support.
203+
204+
If GTID is enabled on a source server, newly created replicas will also have GTID enabled and use GTID replication. To keep replication consistent, you cannot update `gtid_mode` on the source or replica server(s).
205+
176206
### Other
177207

178-
- Global transaction identifiers (GTID) are not supported.
179208
- Creating a replica of a replica is not supported.
180209
- In-memory tables may cause replicas to become out of sync. This is a limitation of the MySQL replication technology. Read more in the [MySQL reference documentation](https://dev.mysql.com/doc/refman/5.7/en/replication-features-memory.html) for more information.
181210
- Ensure the source server tables have primary keys. Lack of primary keys may result in replication latency between the source and replicas.

0 commit comments

Comments
 (0)