content_image/694457.jpg
• ON 

It is important to note that the state of gtid_mode  can only be changed by one step at a time based on the above order. For example, if gtid_mode  is currently set to OFF_PERMISSIVE , it is possible to change to OFF  or ON_PERMISSIVE  but not to ON . This is to ensure that the process of changing from anonymous transactions to GTID transactions online is correctly handled by the server. When you switch between gtid_mode=ON  and gtid_mode=OFF , the GTID state (in other words the value of gtid_executed ) is persistent. This ensures that the GTID set that has been applied by the server is always retained, regardless of changes between types of gtid_mode . 

The fields related to GTIDs display the correct information regardless of the currently selected gtid_mode . This means that fields which display GTID sets, such as gtid_executed , gtid_purged , RECEIVED_TRANSACTION_SET  in the replication_connection_status  Performance Schema table, and the GTID related results of SHOW REPLICA | SLAVE STATUS , now return the empty string when there are no GTIDs present. Fields that display a single GTID, such as CURRENT_TRANSACTION  in the Performance Schema replication_applier_status_by_worker  table, now display ANONYMOUS when GTID transactions are not being used. 

Replication from a source using gtid_mode=ON  provides the ability to use GTID auto-positioning, configured using the SOURCE_AUTO_POSITION  of the CHANGE REPLICATION SOURCE TO  statement (from MySQL 8.0.23), or the MASTER_AUTO_POSITION  option of the CHANGE MASTER TO  statement (before MySQL 8.0.23). The replication topology being used impacts on whether it is possible to enable auto-positioning or not, as this feature relies on GTIDs and is not compatible with anonymous transactions. It is strongly recommended to ensure there are no anonymous transactions remaining in the topology before enabling auto-positioning, see Section 17.1.4.2, “Enabling GTID Transactions Online” . 

The valid combinations of gtid_mode  and auto-positioning on source and replica are shown in the following table, where the source’s gtid_mode  is shown on the horizontal and the replica’s gtid_mode  is on the vertical. The meaning of each entry is as follows: 

• Y : the gtid_mode  of source and replica is compatible 

• N : the gtid_mode  of source and replica is not compatible 

• * : auto-positioning can be used with this combination 

## Table 17.1 Valid Combinations of Source and Replica gtid_mode 

<img src='content_image/694457.jpg'>

The currently selected gtid_mode  also impacts on the gtid_next  variable. The following table shows the behavior of the server for the different values of gtid_mode  and gtid_next . The meaning of each entry is as follows: 

• ANONYMOUS : generate an anonymous transaction. 

• Error : generate an error and fail to execute SET GTID_NEXT . 

