[MXS-1417] draining a node should be possible like haproxy does Created: 2017-09-15  Updated: 2018-05-23  Resolved: 2018-05-23

Status: Closed
Project: MariaDB MaxScale
Component/s: maxctrl
Affects Version/s: 2.1.7
Fix Version/s: 2.3.0

Type: New Feature Priority: Major
Reporter: Oli Sennhauser Assignee: markus makela
Resolution: Fixed Votes: 1
Labels: None
Environment:

linux ubuntu 14.04 n.a


Sprint: MXS-SPRINT-58

 Description   

set server xxx maintenance causes existing connections to abort. it would be much nicer to have a set server xxx drain as haproxy does

see irc conversions with markus

(09:04:57) shinguz: does MaxScale 2.1 really not allow draining a node as HAproxy does?
(09:05:14) markusjm: what do you mean by draining?
(09:05:16) shinguz: I could only find maintenance in the doku
(09:05:34) markusjm: prevent new connections from being created?
(09:06:25) shinguz: prevent new connections from being created (as maintenance does) and keep old open until they are finished
(09:06:45) markusjm: you can remove the server from the service and won't be used by new connections
(09:06:54) shinguz: maintenance in MaxScale disconnects sessions as I have experienced in some tests
(09:06:58) markusjm: give me a sec and I'll point you to the docs
(09:07:22) markusjm: but you're right, it's not something that's very obvious and I think it could be documented better
(09:07:38) markusjm: https://mariadb.com/kb/en/mariadb-enterprise/mariadb-maxscale-21-maxadmin-admin-interface/#runtime-configuration-changes
(09:07:39) shinguz: what? that it disconnects old connections?
(09:08:11) markusjm: I was referring to the fact that removing a server is the same as draining a server
(09:08:27) shinguz: aha
(09:08:32) shinguz: I see, thanks!
(09:08:37) markusjm: so you should be able to do that in 2.1 with `maxadmin remove server <server> <service>`
(09:08:54) markusjm: it's sort of like a soft-maintenance mode
(09:08:55) shinguz: I see
(09:09:14) shinguz: but needs an add again and this is error prone
(09:09:55) shinguz: so set server nodeC drain imho is more intuitive...
(09:10:09) markusjm: that's true
(09:10:17) shinguz: feature request?
(09:10:27) markusjm: but from a conceptual point of view, you want to remove a server from the list of available servers for a service
(09:10:36) shinguz: no
(09:10:39) markusjm: a feature request would be good
(09:10:59) markusjm: out of curiosity, why do you want to drain the server?
(09:11:08) shinguz: when I put it to maintenance I also do not want to remove it from the entity service I want to put it in maintenance
(09:11:19) shinguz: because we get errors on existing connections
(09:11:25) shinguz: and this is ugly
(09:11:50) shinguz: so we want to drain a server until everybody has finished his work
(09:11:56) shinguz: and then put it in maintenanxce
(09:12:08) shinguz: so no lost connections
(09:12:16) markusjm: yup, that makes perfect sense
(09:12:21) shinguz: for example applications which do persistent connections
(09:12:33) shinguz: ok. I will write feature request
(09:12:46) shinguz: any preference or assignments? shall I mention you?
(09:13:04) markusjm: I think the feature request is quite self-explanatory
(09:13:14) markusjm: but please do, I like being mentioned
(09:13:37) shinguz: .oO(why jira???)
(09:13:40) markusjm: but I don't think it'll get in the next majod release



 Comments   
Comment by Oli Sennhauser [ 2017-09-15 ]

removing a server as markus suggested does not help and shows the same ugly behaviour...

root@mariadb-10.2 [(none)] SQL> SELECT @@hostname, @@wsrep_node_name;
ERROR 2003 (HY000): Routing failed. Session is closed.
root@mariadb-10.2 [(none)] SQL> SELECT @@hostname, @@wsrep_node_name;
ERROR 2013 (HY000): Lost connection to MySQL server during query
root@mariadb-10.2 [(none)] SQL> SELECT @@hostname, @@wsrep_node_name;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 13622
Current database: *** NONE ***

Comment by markus makela [ 2017-09-16 ]

The behavior described above is caused by MXS-1418 and will be fixed in 2.1.8. After MXS-1418 is fixed, this will be an usability improvement and fixing it in 2.2 sounds more reasonable.

Comment by Brad Jorgensen [ 2017-09-22 ]

I am running maxscale 2.1.8 and this is still happening to me.

Comment by markus makela [ 2017-09-23 ]

bradjorgensen do you mean that setting servers into maintenance closes all active connections? This is still expected as MXS-1418 was only about remove server command closing connections.

Comment by markus makela [ 2018-03-26 ]

This could be implemented as a MaxCtrl command: maxctrl drain server <name>

This command would remove the server from all services and wait until the connection count drops to zero. After this, it could set the server into maintenance mode and add it back to the services.

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