[MXS-2972] USE sent to wrong server Created: 2020-04-21  Updated: 2020-08-25  Resolved: 2020-04-24

Status: Closed
Project: MariaDB MaxScale
Component/s: namedserverfilter, schemarouter
Affects Version/s: 2.4.8
Fix Version/s: 2.4.9

Type: Bug Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

The USE database command is sent to the server where the database is located. If routing hint causes a query to be routed to a server which is not the chosen server but has the database, the lack of the USE command can cause the query to fail if the query requires an active default database.



 Comments   
Comment by markus makela [ 2020-04-22 ]

One possible theory is that the caching of the SHOW DATABASES results and the subsequent use of the cached results can assign the database to a different server than it would be assigned to if the reuse of the result wasn't done. This can happen if session 1 stores the result from servers A, B and C which session 2 then later reuses with servers A and C. If a database is assigned to server B, session 2 would not send the USE to server A even though it has it.

This problem is only possible when the namedserverfilter is used to forcibly redirect queries to particular servers.

This particular problem would be solved by MXS-2793 where the cached data contains the database locations of all servers.

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