Comments - Named Server Filter

1 year, 10 months ago Richard Lee

Hi Markus, thanks for the response.
There is no "number of diverted queries" counts in the output from maxctrl show filters.
It shows a table with the following rows:
Filter, Source, Module, Services, Parameters.
This is on v 6.4.0

 
1 year, 10 months ago Markus Mäkelä

Ah, that must be an oversight in the show filters output in MaxCtrl and it doesn't show the filter diagnostics: I opened MXS-4166 for it and it should be fixed for the next release.

You can also access the information directly with curl:

curl -u admin:mariadb localhost:8989/v1/filters

If you've created a new MaxCtrl user or changed the password of the admin user, replace the credentials in the command.

 
1 year, 10 months ago Richard Lee

Lovely thank you, looks like that will tide me over to figure out why my filter isn't working.
Are the forward slashes still not compatible with NamedServerFilter when defining the match in the configuration file?

Still not getting anything diverted with various attempts. Trying to redirect anything SELECT-ing from tables starting with "Finished". ie: FinishedPieces or FinishedPacks.

I've tried the following based on this:

SELECT.*FinishedPacks
^SELECT.*FinishedPacks
*FROM FinishedPacks
FinishedPacks

Note: i'm updating the filter from the web UI

What other conditions would prevent a filter / hint from being considered by the Read-Write-Service?

 
1 year, 10 months ago Markus Mäkelä

I tested the filter by creating it with GUI and using match01=SELECT.*FinishedPacks and target01=->master and it appears to work correctly:

info: > Autocommit: [enabled], trx is [not open], cmd: (0x03) COM_QUERY, plen: 44, type: QUERY_TYPE_READ, stmt: SELECT * FROM FinishedPacks WHERE 1 = 1, Hint: HINT_ROUTE_TO_MASTER
info: Route query to master: server1 <
info: Reply complete from 'server1' (Error: 1146, 42S02 Table 'test.FinishedPacks' doesn't exist)
info: > Autocommit: [enabled], trx is [not open], cmd: (0x03) COM_QUERY, plen: 49, type: QUERY_TYPE_READ, stmt: SELECT * FROM FinishedOtherPacks WHERE 1 = 1
info: Route query to slave: server2 <
info: Reply complete from 'server2' (Error: 1146, 42S02 Table 'test.FinishedOtherPacks' doesn't exist)
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.