[MXS-2427] namedserverfilter fails to direct query if first server listed in targetXY is in maintenance mode Created: 2019-04-06  Updated: 2020-08-25  Resolved: 2019-05-08

Status: Closed
Project: MariaDB MaxScale
Component/s: readwritesplit
Affects Version/s: 2.3.5
Fix Version/s: 2.3.7

Type: Bug Priority: Major
Reporter: Chris Calender (Inactive) Assignee: Esa Korhonen
Resolution: Fixed Votes: 0
Labels: None

Sprint: MXS-SPRINT-80, MXS-SPRINT-81

 Description   

The namedserverfilter fails to direct query if 1st server listed in targetXY is in maintenance mode (or probably otherwise unreachable).

$ maxscale --version
MaxScale 2.3.5
 
[NamedServerFilter]
type=filter
module=namedserverfilter
user=root
match03=^.*$
target03=server2,server3

server2 and server3 are both slaves.

If both server2 and server3 are running, then queries to port 4006 (listening port of RWSplitter) work fine.

If I place server3 (the second listed in targetXY), then it also works fine, and the query is directed to server2.

However, if I place server2 (the first listed in targetXY) into maintenance mode:

set server server2 maintenance

Then the query fails:

$ mysql -uroot -pxxx -h127.0.0.1 -P4006 -e"select @@port"
ERROR 2013 (HY000) at line 1: Lost connection to MySQL server during query

And I see this in the error log:

2019-04-06 01:03:14   info   : (13) > Autocommit: [enabled], trx is [not open], cmd: (0x03) COM_QUERY, plen: 18, type: QUERY_TYPE_READ|QUERY_TYPE_SYSVAR_READ, stmt: select @@port, Hint: HINT_ROUTE_TO_NAMED_SERVER
2019-04-06 01:03:14   info   : (13) Hint: route to server 'server3'
2019-04-06 01:03:14   info   : (13) Hint: route to server 'server2'
2019-04-06 01:03:14   info   : (13) Was supposed to route to named server server2 but couldn't find the server in a suitable state. Server state: Maintenance, Running
2019-04-06 01:03:14   error  : (13) Could not find valid server for target type TARGET_SLAVE, closing connection.
2019-04-06 01:03:14   error  : (13) Routing the query failed. Session will be closed.
2019-04-06 01:03:14   info   : Stopped Read-Write-Service client session [13]

It seems like it should attempt other servers listed instead of failing after only checking the first server listed.


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