mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-14 15:34:35 +00:00
BUG/MEDIUM: stats: the web interface must check the tracked servers before enabling
When enabling a tracked server via the web interface, we must first check if the server tracks another one and the state of this tracked server, just like the command line does. Failure to do so causes incorrect logs to be emitted when the server is enabled : [WARNING] 361/212556 (2645) : Server bck2/srv3 is DOWN via bck2/srv2. 2 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue. [WARNING] 361/212603 (2645) : Server bck2/srv3 is DOWN for maintenance. --> enable server now [WARNING] 361/212606 (2645) : Server bck2/srv3 is UP (leaving maintenance). With this fix, it's correct now : [WARNING] 361/212805 (2666) : Server bck2/srv3 is DOWN via bck2/srv2. 2 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue. [WARNING] 361/212813 (2666) : Server bck2/srv3 is DOWN for maintenance. --> enable server now [WARNING] 361/212821 (2666) : Server bck2/srv3 is DOWN via bck2/srv2. 2 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue. It does not seem necessary to backport this fix, considering that it depends on extremely fragile behaviours, there are more risks of breakage caused by a backport than the current inconvenience.
This commit is contained in:
parent
e24d96393a
commit
a3ae932d34
@ -4049,9 +4049,19 @@ static int stats_process_http_post(struct stream_interface *si)
|
||||
break;
|
||||
case ST_ADM_ACTION_ENABLE:
|
||||
if ((px->state != PR_STSTOPPED) && (sv->state & SRV_MAINTAIN)) {
|
||||
/* Already in maintenance, we can change the server state */
|
||||
set_server_up(&sv->check);
|
||||
sv->check.health = sv->check.rise; /* up, but will fall down at first failure */
|
||||
/* Already in maintenance, we can change the server state.
|
||||
* If this server tracks the status of another one,
|
||||
* we must restore the good status.
|
||||
*/
|
||||
if (!sv->track || (sv->track->state & SRV_RUNNING)) {
|
||||
set_server_up(&sv->check);
|
||||
sv->check.health = sv->check.rise; /* up, but will fall down at first failure */
|
||||
}
|
||||
else {
|
||||
sv->state &= ~SRV_MAINTAIN;
|
||||
sv->check.state &= ~CHK_ST_PAUSED;
|
||||
set_server_down(&sv->check);
|
||||
}
|
||||
altered_servers++;
|
||||
total_servers++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user