[MDEV-23168] Implement SESSION_TRACK_GTIDS exactly Created: 2020-07-14  Updated: 2020-10-25

Status: Stalled
Project: MariaDB Server
Component/s: Server
Fix Version/s: None

Type: Task Priority: Major
Reporter: Maarten Manders Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: Compatibility, beginner-friendly

Issue Links:
Relates
relates to MDEV-15170 Implement SESSION_TRACK_GTIDS Closed

 Description   

This issue was previously marked as a duplicate and it was opted to use last_gtid instead I believe. However this causes compatibility issues with ProxySQL for instance, which uses SESSION_TRACK_GTIDS to support causal reads as described here: https://proxysql.com/blog/proxysql-gtid-causal-reads/.

It might prevent someone from migrating from MySQL to MariaDB and cause the reverse instead.



 Comments   
Comment by Sergei Golubchik [ 2020-07-21 ]

would that help? MariaDB gtids are different from MySQL, so proxysql MySQL-specific causal reads might not work on MariaDB with or without SESSION_TRACK_GTIDS

Comment by Justin Gerry [ 2020-09-12 ]

So what would be the proper implementation? I am having this same problem I can't implement MySQL specific casual reads because Proxysql expects session_track_gtids to exist on Mariadb. I've had to take read/write users and pin them to the same group which negates any possible performance advantage. If I switch to Percona/Oracle then this problem would be solvable.

I've seen numerous tickets opened about this issue but there does not appear to be a clear implementation path. I just recently asked for clarification and was told it does support this mechanism in this ticket: CONC-302 but perhaps not in the same way?

However it does not appear to work as its still missing support for the actual variable/parameter. I've noted my findings here: https://github.com/sysown/proxysql/issues/3059

To summerize I see "Unknown system variable 'SESSION_TRACK_GTIDS'" since MariaDB does not have the actual variable.

I'm assuming Proxysql would have to alter the implementation since it expects session_track_gtids to actually exist on the backend MariaDB server.

However it does appear that the OK packet does contain the GTID. https://mariadb.com/kb/en/ok_packet/

Can you offer any suggestions on a way to offer some compatibility? I would assume proxysql would have to alter its implementation and actually attempt to get GTID from that returned packet?

For more background, here is a good way to test implementation of MySQL casual reads: https://github.com/sysown/proxysql/issues/2022

Comment by Sergei Golubchik [ 2020-09-13 ]

Thanks jgerry2002. It seems that ProxySQL might not care that MariaDB gtids are different, if it will just compare them as strings.
rcannao would, of course, know for sure.

I'll reopen this as a feature request.

Comment by Justin Gerry [ 2020-09-14 ]

Very much appreciated as there does seem to be conversation regarding this. Hopefully we can get some traction on this since there is support in the OK packet, it just may need some modifications on the ProxSQL side of things.

Comment by Justin Gerry [ 2020-10-25 ]

@René Cannaò - any comments on this? Seems this implementation is very close to fully functioning if you could provide some comments.

Generated at Thu Feb 08 09:20:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.