Bug #78972 Enabling GTID at startup results in unnecessary GTID sets
Submitted: 27 Oct 2015 4:39 Modified: 18 Aug 2016 11:14
Reporter: Giuseppe Maxia (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.7.9, 5.7.10 OS:Any
Assigned to: CPU Architecture:Any

[27 Oct 2015 4:39] Giuseppe Maxia
Description:
When a server starts with GTID enabled, the server creates a large and unnecessary GTID set:

mysqld --no-defaults --user=$USER --initialize-insecure  \
    --datadir=$PWD/data --basedir=$PWD \
    --explicit_defaults_for_timestamp \
    --gtid-mode=on --enforce-gtid-consistency=on \
    --server-id=100 --log-bin=mysql-bin

mysql> show master status;
+------------------+----------+--------------+------------------+--------------------------------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set                          |
+------------------+----------+--------------+------------------+--------------------------------------------+
| mysql-bin.000002 |      194 |              |                  | f1b7b3e0-7c63-11e5-8833-8fd57ef85ff4:1-133 |
+------------------+----------+--------------+------------------+--------------------------------------------+
1 row in set (0.00 sec)

How to repeat:

Install as described above.

Suggested fix:
The server should use SQL_LOG_BIN=0 when loading system tables.
[27 Oct 2015 8:15] MySQL Verification Team
Hello Giuseppe,

Thank you for the report.

Thanks,
Umesh
[2 Nov 2015 11:05] Giuseppe Maxia
This bug affects all replication systems, including group replication, as noted in http://mysqlhighavailability.com/getting-started-with-mysql-group-replication/#comment-129...
[18 Aug 2016 11:14] Erlend Dahl
[3 Aug 2016 17:55] Christine Cole

Thanks for your feedback, this has been fixed in version 5.7.14. The
following was added to the change log:

A server initialized with --gtid-mode=on and --enforce-gtid-consistency=on
created a large and unnecessary GTID set. The fix adjusts the
initialization process to eliminate the creation of these GTID sets.
[19 Sep 2016 8:16] Erlend Dahl
Bug#81947 binlog should be disabled during --initialize

was marked as a duplicate.