Bug #69096 GTID_NEXT_LIST session variable is not visible
Submitted: 29 Apr 2013 20:52 Modified: 9 Jul 2013 10:01
Reporter: Yoshinori Matsunobu (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.6.11 OS:Any
Assigned to: CPU Architecture:Any

[29 Apr 2013 20:52] Yoshinori Matsunobu
Description:
I tried to recover from an error 'Cannot execute statements with implicit commit inside a transaction when @@SESSION.GTID_NEXT != AUTOMATIC or @@SESSION.GTID_NEXT_LIST != NULL.' (bug#69045), but failed because GTID_NEXT_LIST was not visible.

mysql> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 127.0.0.1
                  Master_User: repl
                  Master_Port: 5611
                Connect_Retry: 60
              Master_Log_File: binary-5611.000003
          Read_Master_Log_Pos: 1810801
               Relay_Log_File: slave-relay-bin.000002
                Relay_Log_Pos: 265272
        Relay_Master_Log_File: binary-5611.000003
             Slave_IO_Running: Yes
            Slave_SQL_Running: No
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 1778
                   Last_Error: Error 'Cannot execute statements with implicit commit inside a transaction when @@SESSION.GTID_NEXT != AUTOMATIC or @@SESSION.GTID_NEXT_LIST != NULL.' on query. Default database: ''. Query: 'flush privileges'
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 265058
              Relay_Log_Space: 1811222
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 1778
               Last_SQL_Error: Error 'Cannot execute statements with implicit commit inside a transaction when @@SESSION.GTID_NEXT != AUTOMATIC or @@SESSION.GTID_NEXT_LIST != NULL.' on query. Default database: ''. Query: 'flush privileges'
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 5611
                  Master_UUID: 03d8526f-b103-11e2-bfc9-0002c9517906
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State:
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp: 130429 13:44:05
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set: 03d8526f-b103-11e2-bfc9-0002c9517906:1-3842
            Executed_Gtid_Set: 03d8526f-b103-11e2-bfc9-0002c9517906:1-1256
                Auto_Position: 1
1 row in set (0.00 sec)

mysql> show variables like '%gtid%';
+--------------------------+-----------+
| Variable_name            | Value     |
+--------------------------+-----------+
| enforce_gtid_consistency | ON        |
| gtid_executed            |           |
| gtid_mode                | ON        |
| gtid_next                | AUTOMATIC |
| gtid_owned               |           |
| gtid_purged              |           |
+--------------------------+-----------+
6 rows in set (0.00 sec)

mysql> set session gtid_next_list="03d8526f-b103-11e2-bfc9-0002c9517906:1257";
ERROR 1193 (HY000): Unknown system variable 'gtid_next_list'

How to repeat:
See bug#69045, and try to recover from the error.

Suggested fix:
HAVE_GTID_NEXT_LIST should be defined in official 5.6.x binary.

./sql/sys_vars.cc:
#ifdef HAVE_GTID_NEXT_LIST
static bool check_gtid_next_list(sys_var *self, THD *thd, set_var *var)
...
[30 Apr 2013 9:00] MySQL Verification Team
Hello Yoshinori,

Thank you for the report.
Verified as described on reported and later versions.

Thanks,
Umesh
[9 Jul 2013 10:01] Jon Stephens
Fixed in 5.6+. Documented as follows in the 5.6.13 and 5.7.2 changelogs:

        In some circumstances, the message in the Last_Error column from the
        output of SHOW SLAVE STATUS referred to GTID_NEXT_LIST although this
        variable is not currently implemented (the name is reserved for 
        possible future use). Now in such cases the error message no longer 
        refers to this variable.

        See also BUG#16715809 and BUG#69045.

Closed.