[MXS-15] Galera system variables are not parsed by the embedded server Created: 2015-01-16 Updated: 2016-03-24 Resolved: 2016-03-24 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | Plugin, readwritesplit |
| Affects Version/s: | 1.0.5 |
| Fix Version/s: | 1.4.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Kolbe Kegel (Inactive) | Assignee: | Massimiliano Pinto (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Environment: |
All OS |
||
| Issue Links: |
|
||||||||
| Description |
|
This is import of bug http://bugs.mariadb.com/show_bug.cgi?id=699 [[Kolbe Kegel 2015-01-16 18:38:15 UTC]]
In a single connection, fetching the values of the same two system variables results in the query being routed differently depending on the order of the variables. Is there some set of variables that should always be routed to the master for some reason? If so, that should be documented. Regardless, the order of terms in the SELECT list should not have any effect on query routing. |
| Comments |
| Comment by Dipti Joshi (Inactive) [ 2015-03-09 ] | |||||
|
This is the comment history as imported from bugzilla Comment 1 Vilho Raatikka 2015-01-16 22:33:38 UTC Comment 2 Kolbe Kegel 2015-01-16 22:35:13 UTC What do you mean by "resolved only in backend" and "MaxScale doesn't know about it"? How is @@wsrep_node_name different in that respect from any other server variable that could be different on any given backend? Comment 3 Vilho Raatikka 2015-01-16 23:01:31 UTC MaxScale doesn't know that there is such system variable as @@wsrep_node_name. In my understanding the reason is that the embedded MariaDB server doesn't have Galera's patch. Thus the variable is unknown. Comment 4 Kolbe Kegel 2015-01-16 23:03:13 UTC Ahh, right. That sounds familiar. But it's still quite strange that the order of variables in the SELECT statement is meaningful, isn't it? Comment 5 Vilho Raatikka 2015-01-16 23:09:47 UTC The effectiveness of atrribute order in SELECT clause is a bug which is fixed in http://bugs.skysql.com/show_bug.cgi?id=694 . MaxScale's inability to detect different system variables is slightly problematic as well but haven't really concentrated on finding a decent solution to it yet. It might, however, be necessary. Comment 6 Vilho Raatikka 2015-01-16 23:55:56 UTC Inability to detect Galera's system variables is hard to overcome since Galera patch doesn't work with embedded library and embedded library doesn't know Galera's system variables. Comment 7 Vilho Raatikka 2015-01-17 09:38:09 UTC There was similar-looking bug in query_classifier before which hide this one. However, debugging and examining the resulting thd and lex for the following queries shows that thd->free_list is non-empty if @@hostname (known variable) is before @@wsrep_node_name. If @@wsrep_node_name is first on the attribute list the resulting thd->free_list==NULL. 1. select @@wsrep_node_name, @@hostname; Both queries produce similar response but routing them to master only limits scalability. Comment 8 Mark Riddoch 2015-01-28 08:39:25 UTC Comment 9 Mark Riddoch 2015-02-13 10:06:08 UTC we have an interesting bug in MaxScale related to parsing. If we try to parse the query select @@wsrep_node_name; Using the embedded server we link with we do not get a parse tree. A select of other system variables works. I guess the parser is resolving the name of the variable rather than leaving it to the execution phase. Since we do not have Galera this variable is unknown. What is even more strange is that if we have a query of the form select @@hostname, @@wsrep_node_name; We do get a parse tree, but reversing the order of the select we again fail to get a parse tree with the query select @@wsrep_node_name, @@hostname; For our purposes we would ideally like to disable the resolving of the variable name at parse time, since that would give us flexibility with regard to new variables being introduced in the servers. Do you know if this is possible or if there is some easy fix we can do to the MariaDB parser that will help us here? For your reference the MaxScale bug report can be found here http://bugs.skysql.com/show_bug.cgi?id=699 Thanks Comment 10 Mark Riddoch 2015-02-13 10:08:34 UTC On Jan 28, Mark Riddoch wrote: Right... That would be very difficult to fix, it'd require a pretty > What is even more strange is that if we have a query of the form That depends on what you call a "parse tree". Items of the select clause For the first query, the list have 1 element, Item_func_get_system_var For the second query the list has 0 elements. In both cases, I've So apparently the parsing as aborted as soon as unknown variable is > For our purposes we would ideally like to disable the resolving of the I don't see how you can do that from MaxScale. Regards, | |||||
| Comment by Dipti Joshi (Inactive) [ 2015-03-18 ] | |||||
|
Since this requires server changes per "Sergei" - Not possible to fix in this release.Moving to 1.2 | |||||
| Comment by Dipti Joshi (Inactive) [ 2015-06-09 ] | |||||
|
Massimiliano Pinto Can you check with Sergei - if the server changes are available ? | |||||
| Comment by Massimiliano Pinto (Inactive) [ 2015-06-15 ] | |||||
|
Nothing has changed in the server. Some pointers: Example for a plugin that creates sysvars: Example of a daemon plugin (wee need to create a daemon plugin): plugin/daemon_example/daemon_example.cc | |||||
| Comment by Johan Wikman [ 2016-03-01 ] | |||||
|
Given the timeframe of 1.4, this must be moved forward to 1.5. | |||||
| Comment by Johan Wikman [ 2016-03-24 ] | |||||
|
Currently, this would be very hard to fix. Quoting Sergey
Consequently, we will close this for now. This limitation has actually been mentioned in MaxScale Limitations' document for some time. However, the problem is still captured in the improvement |