4

I'm setting up 5.6 Percona Mysql, in order to enable GTID should I have to enable log_slave_update on both Master and Slave ?

If I should enable log_slave_update, then I'm counting this to CONS for having GTID.

Also if you can let me know any other issues in having GTID enabled?

RolandoMySQLDBA
  • 182,700
  • 33
  • 317
  • 520
Mannoj
  • 1,551
  • 3
  • 15
  • 36

1 Answers1

2

The MySQL Documentation suggests it : See Setting Up Replication Using GTIDs

Keep in mind that MySQL won't even start up with it. Why ? From the Documentation:

Step 3: Restart both servers with GTIDs enabled. To enable binary logging with global transaction identifiers, each server must be started with GTID mode, binary logging, slave update logging enabled, and with statements that are unsafe for GTID-based replication disabled. In addition, you should prevent unwanted or accidental updates from being performed on either server by starting both in read-only mode. This means that both servers must be started with (at least) the options shown in the following invocation of mysqld_safe:

shell> mysqld_safe --gtid_mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency &

Since binary logging is active on both Master and Slave, the Master's binary logs and the Slave's binary logs will both have GTIDs recorded along with the transactions. This makes it possible for auto-positioning a Slave to its Master using the latest GTID in the Slave when starting Replication. One of the key steps clearly says in that same document page:

Instruct the slave to use the master as the replication data source and to use auto-positioning, and then start the slave.

Therefore, --log-slave-updates must be enabled in order for the auto-positioning mechanism to be active. Even just beyond the mechanism, @jynus points out in his answer to mysql 5.6 gtid replication: is log_slave_updates required? that mysqld won't even bother to start if --log-slave-updates is not specified.

RolandoMySQLDBA
  • 182,700
  • 33
  • 317
  • 520
  • @jynus you are right. I don't use GTID. I guess I am just old school since I am comfortable with binlog coordinates (file and position). I have seen coworkers in my past jobs set it up, have replication break for a variety of reasons, and have a difficult time setting replication back up with GTIDs. My current job does not use it either. – RolandoMySQLDBA Sep 09 '14 at 22:25
  • Gotta commute home, I'll amend later. – RolandoMySQLDBA Sep 09 '14 at 22:30
  • that is during 2014, how about 2019? – neobie Nov 17 '19 at 02:29