BUG/MINOR: server: update last_change on maint->ready transitions too
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Aug 2021 17:35:13 +0000 (19:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Aug 2021 15:03:13 +0000 (17:03 +0200)
commitc6c8cd92a1ef8ac360f51ce5c9d0a7b784c64d65
tree65713ef771ed66480c306a87045e5e2b1063a145
parentbc54716f94c1b8cde916886e6bffb536ad96036c
BUG/MINOR: server: update last_change on maint->ready transitions too

Nenad noticed that when leaving maintenance, the servers' last_change
field was not updated. This is visible in the Status column of the stats
page in front of the state, as the cumuled time spent in the current state
is wrong, it starts from the last transition (typically ready->maint). In
addition, the backend's state was not updated either, because the down
transition is performed by set_backend_down() which also emits a log, and
it is this function which was extended to update the backend's last_change,
but it's not called for down->up transitions so that was not done.

The most visible (and unpleasant) effect of this bug is that it affects
slowstart so such a server could immediately restart with a significant
load ratio.

This should likely be backported to all stable releases.

(cherry picked from commit d332f1396b101f3f03e9fef405d42f03fc3647b6)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit f79c4cf84967ffcc96e375c48afcb472ad246876)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/server.c