[MXS-2501] filter hint route to master , can't send 2 requests Created: 2019-05-22  Updated: 2019-10-18  Resolved: 2019-10-18

Status: Closed
Project: MariaDB MaxScale
Component/s: hintfilter
Affects Version/s: 2.3.7
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Stephane Assignee: markus makela
Resolution: Cannot Reproduce Votes: 0
Labels: None
Environment:

centos 7, php7, mysqli



 Description   

Hello,

We recently migrated from 1.3 to 2.3.7, and our application is/was using the filter hint
'-- maxscale route to master' on some requests.

Under 2.3.7, we noticed that it works for the first mysqli request, but if we do another request just after, we got a NULL reply.
The db handle is also showing a sqlstate = #HY000. (not immediatly after the first request, but just after.).

So, if we use a hintfilter, we are obliged to call again a mysqli_connect (this was not the case under 1.3.)

Not sure if it's a bug or something new, is there a way to fix this ?

thanks in advance,



 Comments   
Comment by markus makela [ 2019-05-22 ]

We would need more information:

  • The exact error message
  • MaxScale logs at the time the problem occurred
  • MaxScale configuration
Comment by Stephane [ 2019-05-22 ]

the maxscale configuration:
[maxscale]
threads=8
auth_connect_timeout=20
auth_read_timeout=20
auth_write_timeout=20
log_trace=0

[MySQL Monitor VHD]
type=monitor
module=mariadbmon
servers=dbvhd1,dbvhd2
user=xxxxxx
password=xxxxxxxx
monitor_interval=2000
#disable_master_failback=1
auto_failover=0
detect_replication_lag=1

[MySQL Monitor Accounts]
type=monitor
module=mariadbmon
servers=dbaccounts1,dbaccounts2
user=xxxxxxx
password=xxxxxxxxx
monitor_interval=2000
#disable_master_failback=1
auto_failover=0
detect_replication_lag=1

[MySQL Monitor Torrents]
type=monitor
module=mariadbmon
servers=dbtorrents1,dbtorrents2
user=xxxxxxxxx
password=xxxxxxxxx
monitor_interval=2000
#disable_master_failback=1
auto_failover=0
detect_replication_lag=1

[MySQL Monitor Others]
type=monitor
module=mariadbmon
servers=dbothers1,dbothers2
user=xxxxxxxx
password=xxxxxxxx
monitor_interval=2000
#disable_master_failback=1
auto_failover=0
detect_replication_lag=1

[qla]
type=filter
module=qlafilter
#options=/tmp/QueryLog
filebase=/tmp/SqlQueryLog

[fetch]
type=filter
module=regexfilter
match=fetch
replace=select

[hint]
type=filter
module=hintfilter

[RWVHD]
type=service
router=readwritesplit
servers=dbvhd1, dbvhd2
user=xxxxxxxx
password=xxxxxxxx
max_slave_replication_lag=3
max_slave_connections=100%
#router_options=master_accept_reads=true
filters=hint
#router_options=slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS
#weightby=myweight
master_accept_reads=true
connection_keepalive=40

[VHDLISTENER]
type=listener
service=RWVHD
protocol=MySQLClient
port=3310
#socket=/tmp/ClusterMaster1

[RWACCOUNTS]
type=service
router=readwritesplit
servers=dbaccounts1, dbaccounts2
user=xxxxxxxx
password=xxxxxxxx
max_slave_replication_lag=3
filters=hint
#router_options=master_accept_reads=true
connection_keepalive=40

[ACCOUNTSLISTENER]
type=listener
service=RWACCOUNTS
protocol=MySQLClient
port=3311
#socket=/tmp/ClusterMaster2

[RWTORRENTS]
type=service
router=readwritesplit
servers=dbtorrents1, dbtorrents2
user=xxxxxxxx
password=xxxxxxxxx
max_slave_replication_lag=10
connection_keepalive=40

[TORRENTSLISTENER]
type=listener
service=RWTORRENTS
protocol=MySQLClient
port=3312
#socket=/tmp/ClusterMaster3

[RWOTHERS]
type=service
router=readwritesplit
servers=dbothers1, dbothers2
user=xxxxxxxx
password=xxxxxxxxxx
max_slave_replication_lag=3
#router_options=master_accept_reads=true
connection_keepalive=40

[OTHERSLISTENER]
type=listener
service=RWOTHERS
protocol=MySQLClient
port=3313
#socket=/tmp/ClusterMaster4

[dbvhd1]
type=server
address=10.0.0.36
port=3306
protocol=MySQLBackend
weight=1

[dbvhd2]
type=server
address=10.0.0.38
port=3306
protocol=MySQLBackend
weight=1

[dbaccounts1]
type=server
address=10.0.0.40
port=3306
protocol=MySQLBackend

[dbaccounts2]
type=server
address=10.0.0.42
port=3306
protocol=MySQLBackend

[dbtorrents1]
type=server
address=10.0.0.44
port=3306
protocol=MySQLBackend

[dbtorrents2]
type=server
address=10.0.0.46
port=3306
protocol=MySQLBackend

[dbothers1]
type=server
address=10.0.0.48
port=3306
protocol=MySQLBackend

[dbothers2]
type=server
address=10.0.0.54
port=3306
protocol=MySQLBackend

[CLI]
type=service
router=cli

[CLI Listener]
type=listener
service=CLI
protocol=maxscaled
#address=localhost
#port=6603
socket=default

--------------------------------------

error logs:

nothing shows up in the maxscale logs when it happens.

and during the php script, no error as well, just the mysqli response which is NULL, and then the mysqli handle state which becomes ["sqlstate"]=> string(5) "HY000"

(service concerned in the conf above: RWVHD)

------------------

Comment by markus makela [ 2019-07-02 ]

Does it return any sort of an error? The SQLSTATE suggests that something caused an error to be sent to the client.

Comment by Stephane [ 2019-07-03 ]

no error, only if I send the second request, it returns null.

if I look at the sql state before sending the second request, no error.
if I look at the sql state after the second request, it shows the error state

Comment by markus makela [ 2019-07-03 ]

You can add log_info=1 under the [maxscale] section in the configuration file and restart maxscale to enable verbose logging. Please enable it and try again: the log messages should explain what is happening and where the queries are routed. Once you have the log with log_info=1, make sure there's on sensitive information in it and attach it to this issue.

Comment by markus makela [ 2019-10-18 ]

Closing as Cannot Reproduce due to no updates on this. If you still see the problem with the latest version, please provide the logs and an example test case that reproduces it.

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