[MXS-1670] "alter server abc address=..." does not immediately register in monitor Created: 2018-02-15  Updated: 2020-04-14  Resolved: 2020-04-14

Status: Closed
Project: MariaDB MaxScale
Component/s: mariadbmon, REST-API
Affects Version/s: 2.2.2
Fix Version/s: 2.5.0

Type: Bug Priority: Minor
Reporter: Esa Korhonen Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None

Attachments: PNG File Screen Shot 2020-04-13 at 8.27.55 PM.png    
Sprint: MXS-SPRINT-103

 Description   

If altering server address to an invalid address, the monitor does not take address to use unless the monitor is stopped and restarted.

MaxScale> list servers
Servers.
-------------------+-----------------+-------+-------------+--------------------
Server             | Address         | Port  | Connections | Status              
-------------------+-----------------+-------+-------------+--------------------
LocalMaster1       | 127.0.0.1       |  3001 |           0 | Master, Running
LocalSlave1        | 127.0.0.1       |  3002 |           0 | Slave, Running
LocalSlave2        | 127.0.0.1       |  3003 |           0 | Slave, Running
-------------------+-----------------+-------+-------------+--------------------
MaxScale> alter server LocalMaster1 address=nowhere
MaxScale> list servers
Servers.
-------------------+-----------------+-------+-------------+--------------------
Server             | Address         | Port  | Connections | Status              
-------------------+-----------------+-------+-------------+--------------------
LocalMaster1       | nowhere         |  3001 |           0 | Master, Running
LocalSlave1        | 127.0.0.1       |  3002 |           0 | Slave, Running
LocalSlave2        | 127.0.0.1       |  3003 |           0 | Slave, Running
-------------------+-----------------+-------+-------------+--------------------
MaxScale> call command mariadbmon switchover MariaDB-Monitor LocalSlave1
MaxScale> list servers
Servers.
-------------------+-----------------+-------+-------------+--------------------
Server             | Address         | Port  | Connections | Status              
-------------------+-----------------+-------+-------------+--------------------
LocalMaster1       | nowhere         |  3001 |           0 | Slave, Running
LocalSlave1        | 127.0.0.1       |  3002 |           0 | Master, Running
LocalSlave2        | 127.0.0.1       |  3003 |           0 | Slave, Running
-------------------+-----------------+-------+-------------+--------------------
MaxScale> shutdown monitor MariaDB-Monitor
MaxScale> restart monitor MariaDB-Monitor
MaxScale> list servers
Servers.
-------------------+-----------------+-------+-------------+--------------------
Server             | Address         | Port  | Connections | Status              
-------------------+-----------------+-------+-------------+--------------------
LocalMaster1       | nowhere         |  3001 |           0 | Down
LocalSlave1        | 127.0.0.1       |  3002 |           1 | Master, Running
LocalSlave2        | 127.0.0.1       |  3003 |           1 | Slave, Running
-------------------+-----------------+-------+-------------+--------------------
MaxScale> alter server LocalMaster1 address=127.0.0.1
MaxScale> list servers
Servers.
-------------------+-----------------+-------+-------------+--------------------
Server             | Address         | Port  | Connections | Status              
-------------------+-----------------+-------+-------------+--------------------
LocalMaster1       | 127.0.0.1       |  3001 |           0 | Slave, Running
LocalSlave1        | 127.0.0.1       |  3002 |           1 | Master, Running
LocalSlave2        | 127.0.0.1       |  3003 |           1 | Slave, Running
-------------------+-----------------+-------+-------------+--------------------

The router does detect the error immediately.



 Comments   
Comment by markus makela [ 2020-02-03 ]

The monitor that monitors the server should probably be restarted whenever a server it monitors changes.

Comment by markus makela [ 2020-04-14 ]

The monitor is restarted whenever changes to servers are done via the REST API.

Comment by Johan Wikman [ 2020-04-14 ]

Ah, ok. I assumed the backend implementation was the same.

Anyway, I think it would be better to reject changes made to a monitored server, if the monitor is running.

Comment by markus makela [ 2020-04-14 ]

That would render alter server pretty cumbersome to use and the restart is done only to recycle the connections.

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