Bug #80342 session_track_gtids is not optimal
Submitted: 11 Feb 2016 15:04 Modified: 11 Feb 2016 15:42
Reporter: Mikiya Okuno Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.7.11 OS:Any
Assigned to: CPU Architecture:Any

[11 Feb 2016 15:04] Mikiya Okuno
Currently, session_track_gtids system variable may have either of following values:


The reference manual states about OWN_GTID as follows: OWN_GTID configures the tracker to collect GTIDs generated by successfully committed read/write transactions.

This is untrue. OWN_GTID reflects simply gtid_owned. So, GTID is included in OK packet only when gtid_next is set beforehand. This is not useful.

How to repeat:
See attachment.

Suggested fix:
Change the behavior of session_track_gtids according to the manual. I suggest to have an additional member to hold the last gtid in THD class, or change the meanings of THD::owned_gtid and hold the last gtid in it.
[11 Feb 2016 15:05] MySQL Verification Team
Ugly ugly test program. Modify credentials according to your environment.

Attachment: gtid-test.c (text/x-csrc), 3.84 KiB.

[11 Feb 2016 15:07] MySQL Verification Team
You need following server options to run this program:

[11 Feb 2016 15:09] MySQL Verification Team
The test program can return GTID in the OK packet, actually. Because it issues a "SET GTID_NEXT" command beforehand. IMHO, "SET GTID_NEXT" should be unnecessary.
[11 Feb 2016 15:29] MySQL Verification Team
Test program without SET GTID_NEXT

Attachment: gtid-test-rev2.c (text/x-csrc), 2.48 KiB.

[11 Feb 2016 15:42] MySQL Verification Team
I'm sorry. I made a mistake in sequence of calling API functions. This is not a bug. Please close.