Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
None
-
None
Description
We have a simple setup of two MariaDB 10.5.13 servers (RHEL builds, as we're on RHEL-9 and MariaDB does not provide builds of for RHEL-9 yet) and MaxScale 6.2.4 in front of them. The backend servers are independent (no replication).
MaxScale is configured with a schema router to which a hint filter is attached. The goal is simple - to allow the connected client to specify which backend should get a DDL like "CREATE DATABASE"; this is the basic for having schema-based sharding without direct access to the shards.
As per our KB, this is possible: "Without a default database, queries [...] that do not modify the session state will be routed to the first available server. This includes queries such as CREATE DATABASE db1. Such queries should be done directly on the node or the router should be equipped with the hint filter and a routing hint should be used."
https://mariadb.com/kb/en/mariadb-maxscale-6-schemarouter/
Sadly, this seems not to work:
[root@a1w2 maxscale.cnf.d]# maxctrl list servers --tsv
server-8-19 10.100.1.16 3306 1 Running 0-19-27
server-8-20 10.100.1.17 3306 1 Master, Running 0-20-9
[root@a1w2 maxscale.cnf.d]# maxctrl list services --tsv
service-8 schemarouter 1 1 server-8-19, server-8-20
[root@a1w2 maxscale.cnf.d]# maxctrl list filters --tsv
filter-8 service-8 hintfilter
MariaDB [(none)]> create database g7; – maxscale route to server server-8-20
Query OK, 1 row affected (0.006 sec)
2022-07-20 22:08:09 info : (1) > Autocommit: [enabled], trx is [not open], cmd: (0x03) COM_QUERY, plen: 23, type: QUERY_TYPE_WRITE, stmt: create database g7
2022-07-20 22:08:09 info : (1) [schemarouter] (service-8); > Command: COM_QUERY, stmt: create database g7
2022-07-20 22:08:09 info : (1) [schemarouter] (service-8); Route query to server-8-19 <
2022-07-20 22:08:09 info : (1) [schemarouter] (service-8); Reply complete from 'server-8-19'
Note that the MariaDB CLI does not have a default DB set (and had not had since the session was created). The session is opened by a remote root user that is present on both backends.
Summary: the DDL is always sent to the "first" shard even though we added a hint to send it to the second shard.
We have the log_debug turned on in both MaxScale config and the service, but it produces no extra output - possibly, because this is a production build?
We cannot (yet) try a newer MaxScale, because we run on RHEL-9 and MaxScale still does not have builds for RHEL-9,so we use the last package for RHEL-8 that can be installed on RHEL-9 (packages of newer MaxScale versions are set to depend on an exact version of some extra library, which version is only found in RHEL-8 and RHEL-9 has a newer one, preventing the package from installing).
I could not find in this Jira any similar issue, hence this ticket; apologies if this is know or has been resolved, or if we still missed something in the configuration.