[MXS-4116] Add possibility to choose primary source for schemarouter Created: 2022-04-29  Updated: 2023-04-04  Resolved: 2023-04-04

Status: Closed
Project: MariaDB MaxScale
Component/s: schemarouter
Affects Version/s: None
Fix Version/s: N/A

Type: New Feature Priority: Major
Reporter: Richard Stracke Assignee: Todd Stoffel (Inactive)
Resolution: Won't Do Votes: 0
Labels: None

Issue Links:
Relates
relates to MXS-4077 Show all databases with schemarouter ... Closed

 Description   

When a Schemarouter query the database , epecially information_schema,
it is not determined, which server will be queried.

According the the shown tables and databases,
where the source is information_schema.schemata and show databases,
the output is different , depending which server will be queried.

select @@hostname, @@server_id, t.* from information_schema.schemata t; 

In addition Maxscale choose different server in Maxscals 2.4 and 2.5/6
in the automatic selection process.

Adding a simple command should give the user more control, which server should be used.

A workaround is using hintfilter

select @@hostname, @@server_id, t.* from information_schema.schemata t; – maxscale route to server 2

https://mariadb.com/kb/en/mariadb-maxscale-6-hintfilter/#hintfilter

But this not works for all usecases.

Adding a new command to choose the primary server for schemarouter override the automatic selection.

alter service schemarouter primary_server server2

This gives more controil over the schemarouter behaviour.



 Comments   
Comment by markus makela [ 2022-05-06 ]

You could also use the namedserverfilter to match queries against those tables and route them to the server you want.

Comment by markus makela [ 2023-04-04 ]

Since this can fixed with the namedserverfilter, having a specific option just for information_schema queries seems excessive.

Generated at Thu Feb 08 04:26:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.