[MXS-1357] master_accept_reads enabled and slave doesn't get any load in ReadWrite split mode Created: 2017-08-14  Updated: 2017-08-22  Resolved: 2017-08-22

Status: Closed
Project: MariaDB MaxScale
Component/s: N/A
Affects Version/s: 2.1.4, 2.1.5
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Maiavria Assignee: markus makela
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

Debian Jessie on VMWARE


Attachments: PNG File MUNIN maxscale load.png    

 Description   

Hello,

I have following Maxscale configuration for read-write splitting the load between maria1 and maria3; maria2 is used for backup purpose only so it has the last priority and weight=0.

This configuration is used for a Galera Cluster of 3 MariaDB nodes in 10.1 version branch.

I'm using Maxscale 2.1.4 and I don't know why but the SELECT statements go all to maria1, and none to maria3.

[RW]
type=service
router=readwritesplit
servers=maria1,maria2,maria3
max_slave_connections=1
router_options=slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS,master_accept_reads=true
user=mastersplit
localhost_match_wildcard_host=1
weightby=myweight
 
 
[maria1]
type=server
address=10.181.111.74
protocol=MySQLBackend
priority=1
myweight=1
 
[maria2]
type=server
address=10.181.111.32
protocol=MySQLBackend
priority=3
myweight=0
 
[maria3]
type=server
address=10.181.111.14
protocol=MySQLBackend
priority=2
myweight=1

The command

SELECT @@hostname

is always returning the first node's name even without the option master_accept_reads.

I also tried with :

router_options=slave_selection_criteria=LEAST_CURRENT_OPERATIONS,master_accept_reads=true

I attached a screen cap of the observed load of queries on all 3 servers grouped by query type.

Node 1 is getting all the load from maxscale and node 3 isn't even getting a part of the SELECT load.

The strange thing this is that maxscale's RW Split service shows that 49% goes to slaves :
Number of queries forwarded to master: 17530969 (50.20%)
Number of queries forwarded to slave: 17392880 (49.80%)
Number of queries forwarded to all: 5062417 (14.50%)

But as master_accept_reads=1, it seems that master=master and slave=master too without the weight being taken into account because there isn't event 10% load going to node 3.

Expected behavior would be :75% of the load going to master (50% as master + 25% because master_accept_reads=1 and weight is 1/2) and 25% of the SELECT load going to slave node3.



 Comments   
Comment by markus makela [ 2017-08-21 ]

Please try enabling the info log level by adding log_info=true under the maxscale section. This will log each statement processed by MaxScale. Check that the SELECT statements aren't done inside transactions and that autocommit is enabled.

Comment by Maiavria [ 2017-08-22 ]

Solved changing the configuration to

max_slave_connections=100%
router_options=slave_selection_criteria=LEAST_CURRENT_OPERATIONS,master_accept_reads=true 

The problem was that max_slave_connections was only set to 1 as explained by Markus on this topic : https://groups.google.com/forum/#!topic/maxscale/aXmyizCtF84

Thank you!

Comment by markus makela [ 2017-08-22 ]

Closing as the issue was solved.

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