sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
6.06k stars 983 forks source link

Mariadb and session_track_gtids - appears to be support from Mariadb but does not function #3059

Open jgerry2002 opened 4 years ago

jgerry2002 commented 4 years ago

Not sure if this should be a feature request or logging of a bug. The article here -> https://proxysql.com/blog/proxysql-gtid-causal-reads/ states that session_track_gtids will hopefully implemented soon with Mariadb. It appears that this has been done, but perhaps not in the same way is Percona/Oracle MySQL?

Reference documents for Mariadb - one article is technically for maxscale but it appears to do the same end result which is casual reads. https://mariadb.com/kb/en/ok_packet/ https://mariadb.com/docs/solutions/maxscale/routers/readwritesplit/ensure-causal-consistency-maxscale-read-write-split-router/#enabling-causal-reads-on-mariadb-server

I have a RHEL 8.2 system with Mariadb 10.4.14 with Proxysql 2.0.13 on it.

As as test I've setup a simple 3 node cluster with split read/write. I've set the following global options in proxyql:

mysql-client_session_track_gtid: true
mysql-default_session_track_gtids: OWN_GTID

On the mariadb nodes I've set:

set @@session.session_track_state_change=ON
set @@session.session_track_system_variables='autocommit,character_set_client,character_set_connection,character_set_results,last_gtid,time_zone';
set @@session.session_track_transaction_info=CHARACTERISITICS

According to Mariadb they have supposedly implemented this - but the session variable for this does not exist still which throws an error on the proxysql side.

Proxysql Error Logs: MySQL_Session.cpp:2259:handler_again___status_SETTING_GENERIC_VARIABLE(): [WARNING] Error while setting SESSION_TRACK_GTIDS to "OWN_GTID" on vdb-mysql-01.server.local:3306 hg 10 : 1193, Unknown system variable 'SESSION_TRACK_GTIDS' Of course Mariadb still does not have the session_track_gtids variable field like percona/oracle mysql and that may be the problem. The implementation really is not complete.

Is this still not possible or is the implementation just different enough that proxysql does not have support for it? It didnt seem to gain much traction on the mariadb side when I looked at various tickets.

jgerry2002 commented 4 years ago

I was able to get MariaDB to reopen this issue. OK packet has the data that is needed, but I believe ProxySQL would need to be modified or MariaDB would be required to add the session_track_gtids that ProxySQL is looking for. MariaDB seems to be willing to look at this issue again.

See this for more details: https://jira.mariadb.org/browse/MDEV-23168

shahariaazam commented 3 years ago

Any update on that yet? Mentioned ticket from MariaDB seems stalled. Based on session_track_gtids, I think if there is any possibility to fix proxysql that would be better than waiting for MariaDB. We can discuss about proposed solutions to fix ProxySQL? Any idea if we need to make changes for ProxySQL?

jgerry2002 commented 3 years ago

Zero comments from @renecannao on the open ticket with mariadb. This really needs some input from him or someone on the proxysql team. Its stalled waiting for comment. The fix seems like it would be straight forward.

timo-schluessler commented 2 years ago

I think this this depends on something like #3978.