Bug #64684 Using global transaction ID, log reading gets an error after FLUSH LOGS
Submitted: 18 Mar 2012 20:03 Modified: 1 Apr 2012 15:16
Reporter: Giuseppe Maxia Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Logging Severity:S2 (Serious)
Version:5.6.4-labs OS:Linux (CentOS 5.5)
Assigned to: CPU Architecture:Any
Tags: GTID

[18 Mar 2012 20:03] Giuseppe Maxia
Description:
Install a server with binary logs enabled, using the binaries from MySQL labs (global transaction ID).

create a table, then flush logs, then insert one record, and flush logs again.

Reading the first log is OK. Reading the second one generates an error:
ERROR: Error in Log_event::read_log_event(): 'read error', data_len: 1869901417, event_type: 115
ERROR: Could not read entry at offset 284: Error in log format or read error.

Sample output:

~/sandboxes/msb_5_6_4/my sqlbinlog ~/sandboxes/msb_5_6_4/data/mysql-bin.000002
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
SET UGID_NEXT='ANONYMOUS'/*!*/;
#120318 20:55:37 server id 5604  end_log_pos 114 	Start: binlog v 4, server v 5.6.4-labs-global-trans-ids-log created 120318 20:55:37
BINLOG '
uT1mTw/kFQAAbgAAAHIAAAAAAAQANS42LjQtbGFicy1nbG9iYWwtdHJhbnMtaWRzLWxvZwAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAGhhotU=
'/*!*/;
# at 114
# Subgroup(#1, 3DE96EE6-7134-11E1-9A60-00265531A0CC:1, END, COMMIT, binlog(no=0, pos=114, len=143, oals=0))
SET UGID_NEXT='3DE96EE6-7134-11E1-9A60-00265531A0CC:1', UGID_END=0, UGID_COMMIT=0/*!*/;
#120318 20:55:47 server id 5604  end_log_pos 189 	Query	thread_id=3	exec_time=0	error_code=0
SET TIMESTAMP=1332100547/*!*/;
SET @@session.pseudo_thread_id=3/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
# at 189
# Subgroup(#1, 3DE96EE6-7134-11E1-9A60-00265531A0CC:1, END, COMMIT, binlog(no=0, pos=114, len=143, oals=0))
SET UGID_END=1, UGID_COMMIT=1/*!*/;
#120318 20:55:47 server id 5604  end_log_pos 284 	Query	thread_id=3	exec_time=0	error_code=0
use test/*!*/;
SET TIMESTAMP=1332100547/*!*/;
insert into t1 values (1)
/*!*/;
ERROR: Error in Log_event::read_log_event(): 'read error', data_len: 1869901417, event_type: 115
ERROR: Could not read entry at offset 284: Error in log format or read error.
SET UGID_NEXT='AUTOMATIC'/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;

How to repeat:
create table test.t1(i int not null primary key);
flush logs;
insert into test.t1 values (1);
flush logs;
mysqlbinlog $DATADIR/mysql-bin.000001  # this reads fine
mysqlbinlog $DATADIR/mysql-bin.000002  # this one gets an error
[1 Apr 2012 10:53] Valeriy Kravchuk
Let me copy developer's comment from associated internal bug report:

"I could not reproduce the problem using our internal branch (i.e. trunk). The labs release has an old version of the Global Transaction Identifiers so I suggest you to use (https://code.launchpad.net/~mysql/mysql-server/trunk)."
[1 Apr 2012 15:16] Giuseppe Maxia
The trunk code does not seem to contain the global transaction ID functionality. 
I have compiled both 5.6.4 and 5.6.5, and neither of them produces GTID. Since there is no documentation about this feature, I would appreciate a more specific pointer. Thanks.