Le Mardi 2 Février 2010 23:52:36, Cyril Bonté a écrit :
> Le Mardi 2 Février 2010 23:39:22, Willy Tarreau a écrit :
> > (...)
> > In my opinion the real state is MAINT, and we may complete it with
> > some info indicating that it was propagated from another server.
> > Maybe something such as "MAINT(via)" or "MAINT(auto)" or anything
> > in that vein could be more explicit, I don't know.
>
> "MAINT(via)" looks fine. OK, I'll make the modification so if you want to
> wait before meging, don't hesitate ;)
>
> > Cyril, could you please add the new states to the doc ?
>
> Yes, I can add some details in the "disable server" section. Is it where you
> want an update ?
This time it must be good :)
(replaces haproxy-ss-20100201-maintain3.diff and
haproxy-ss-20100201-maintain4.diff)
--
Cyril Bonté
diff -Naur haproxy-ss-20100201/doc/configuration.txt haproxy-ss-20100201-maintain/doc/configuration.txt
--- haproxy-ss-20100201/doc/configuration.txt 2010-01-31 23:33:18.000000000 +0100
+++ haproxy-ss-20100201-maintain/doc/configuration.txt 2010-02-03 00:13:11.000000000 +0100
@@ -7662,6 +7662,9 @@
If the server is tracked by other servers, those servers will be set to DOWN
during the maintenance.
+ In the statistics page, a server DOWN for maintenance will appear with a
+ "MAINT" status, its tracking servers with the "MAINT(via)" one.
+
Both the backend and the server may be specified either by their name or by
their numeric ID, prefixed with a dash ('#').
diff -Naur haproxy-ss-20100201/src/dumpstats.c haproxy-ss-20100201-maintain/src/dumpstats.c
--- haproxy-ss-20100201/src/dumpstats.c 2010-01-31 23:33:18.000000000 +0100
+++ haproxy-ss-20100201-maintain/src/dumpstats.c 2010-02-03 00:09:57.000000000 +0100
@@ -1697,7 +1697,7 @@
else
sv_state = 0; /* DOWN */
- if ((sv_state == 0) && (s->data_ctx.stats.flags & STAT_HIDE_DOWN)) {
+ if (((sv_state == 0) || (sv->state & SRV_MAINTAIN)) && (s->data_ctx.stats.flags & STAT_HIDE_DOWN)) {
/* do not report servers which are DOWN */
s->data_ctx.stats.sv = sv->next;
continue;
@@ -1708,7 +1708,7 @@
"UP %d/%d ↓", "UP",
"NOLB %d/%d ↓", "NOLB",
"<i>no check</i>" };
- if (sv->state & SRV_MAINTAIN) {
+ if ((sv->state & SRV_MAINTAIN) || (svs->state & SRV_MAINTAIN)) {
chunk_printf(&msg,
/* name */
"<tr class=\"maintain\"><td class=ac"
@@ -1806,9 +1806,14 @@
human_time(now.tv_sec - sv->last_change, 1));
chunk_printf(&msg, "MAINT");
}
+ else if (svs != sv && svs->state & SRV_MAINTAIN) {
+ chunk_printf(&msg, "%s ",
+ human_time(now.tv_sec - svs->last_change, 1));
+ chunk_printf(&msg, "MAINT(via)");
+ }
else if (svs->state & SRV_CHECKED) {
chunk_printf(&msg, "%s ",
- human_time(now.tv_sec - sv->last_change, 1));
+ human_time(now.tv_sec - svs->last_change, 1));
chunk_printf(&msg,
srv_hlt_st[sv_state],
@@ -1916,7 +1921,11 @@
/* status */
if (sv->state & SRV_MAINTAIN) {
chunk_printf(&msg, "MAINT,");
- } else {
+ }
+ else if (svs != sv && svs->state & SRV_MAINTAIN) {
+ chunk_printf(&msg, "MAINT(via),");
+ }
+ else {
chunk_printf(&msg,
srv_hlt_st[sv_state],
(svs->state & SRV_RUNNING) ? (svs->health - svs->rise + 1) : (svs->health),