MINOR: server: remove the SRV_DRAIN flag which can always be deduced
This flag is only a copy of (srv->uweight == 0), so better get rid of
it to reduce some of the confusion that remains in the code, and use
a simple function to return this state based on this weight instead.
diff --git a/src/dumpstats.c b/src/dumpstats.c
index eae736c..13843f8 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -1355,12 +1355,6 @@
return 1;
warning = server_parse_weight_change_request(sv, args[3]);
- /*
- * The user-weight may now be zero and thus
- * the server considered to be draining.
- * Update the server's drain state as necessary.
- */
- set_server_drain_state(sv);
if (warning) {
appctx->ctx.cli.msg = warning;
appctx->st0 = STAT_CLI_PRINT;
@@ -3633,7 +3627,7 @@
else
sv_state = 2; /* going down */
- if (svs->state & SRV_DRAIN)
+ if (server_is_draining(svs))
sv_state += 4;
else if (svs->state & SRV_GOINGDOWN)
sv_state += 2;
@@ -4291,7 +4285,6 @@
sv->uweight = 0;
server_recalc_eweight(sv);
- set_server_drain_state(sv);
altered_servers++;
total_servers++;