[MXS-842] Unexpected / undocumented behaviour when multiple available masters from mmmon monitor Created: 2016-08-26  Updated: 2016-08-30  Resolved: 2016-08-30

Status: Closed
Project: MariaDB MaxScale
Component/s: Documentation, readconnroute
Affects Version/s: 1.4.3
Fix Version/s: 2.0.0

Type: Bug Priority: Minor
Reporter: Michaël de groot Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None

Sprint: 2016-17

 Description   

Hi,

When the mmmon monitor detects multiple masters, the last master is always used by readconnroute:

[Core01 Master read-write Service]
type=service
router=readconnroute
servers=core01,core11
user=maxscale
passwd=***
router_options=master
weightby=masterweight
 
[core01]
type=server
address=customer-prod-db-core01
port=3306
protocol=MySQLBackend
masterweight=1
 
[core11]
type=server
address=customer-prod-db-core11
port=3306
protocol=MySQLBackend
masterweight=0

Two masters can be achieved by (incorrectly) disabling read_only on 2 nodes:

[root@leo-mt-prod-db-maxscale01 ~]# maxadmin -pmariadb show servers
Server 0x2180ad0 (core01)
	Server:                              customer-prod-db-core01
	Status:                              Master, Running
	Protocol:                    MySQLBackend
	Port:                                3306
	Node Id:                     3
	Master Id:                   11
	Repl Depth:                  0
	Number of connections:               0
	Current no. of conns:                0
	Current no. of operations:   0
Server 0x2180930 (core11)
	Server:                              customer-prod-db-core11
	Status:                              Master, Running
	Protocol:                    MySQLBackend
	Port:                                3306
	Node Id:                     11
	Master Id:                   3
	Repl Depth:                  0
	Number of connections:               13
	Current no. of conns:                0
	Current no. of operations:   0

The weightby feature is ignored in this case.

I think this is desired behaviour. In case of a flapping primary node and the failed over node coming back, the read_only could be enabled on both nodes. Perhaps easiest is to document it in the MMMon module? And perhaps in the weightby documentation a note that in case of multiple masters all traffic is always redirected to the last master?

Thanks,
Michaël



 Comments   
Comment by Michaël de groot [ 2016-08-26 ]

Or we could change the monitor to only designate 1 as master and the other one as "Incorrectly configured master node" ?

Comment by markus makela [ 2016-08-30 ]

This could be considered a bug in the readconnroute. When the root master server, the server with the lowest depth in the replication tree, is being chosen, the weights of the masters are ignored. If two servers with equal depth are found, the weights should be compared. The master with the lowest depth and highest weight should be used as the root master.

Comment by markus makela [ 2016-08-30 ]

The server weights are now inspected before the root master is chosen.

Comment by markus makela [ 2016-08-30 ]

The readconnroute module now properly takes weights into notice. If two master servers with equal depth in the replication topology are found, the weighting parameter of the servers is compared. If even the weights are equal, the master which was first listed in the servers parameter of the service is chosen.

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