]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Fixed ignoring an obsolete up/down change while host is desynced.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 5 Jun 2016 11:54:05 +0000 (14:54 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 5 Jun 2016 11:54:05 +0000 (14:54 +0300)
src/director/director-connection.c

index 2beb3270735a93f3466680da13e3e28b50b0b513..1ad6e02f422354412a13d0d756b6894716e2589f 100644 (file)
@@ -927,6 +927,11 @@ director_cmd_host_int(struct director_connection *conn, const char *const *args,
 
                        str_printfa(str, "director(%s): Host %s is being updated before previous update had finished (",
                                  conn->name, net_ip2addr(&host->ip));
+                       if (host->down != down &&
+                           host->last_updown_change > last_updown_change) {
+                               /* our host has a newer change. preserve it. */
+                               down = host->down;
+                       }
                        if (host->down != down) {
                                if (host->down)
                                        str_append(str, "down -> up");
@@ -942,10 +947,6 @@ director_cmd_host_int(struct director_connection *conn, const char *const *args,
                        str_append(str, ") - ");
 
                        vhost_count = I_MIN(vhost_count, host->vhost_count);
-                       if (host->down != down) {
-                               if (host->last_updown_change <= last_updown_change)
-                                       down = host->last_updown_change;
-                       }
                        last_updown_change = I_MAX(last_updown_change,
                                                   host->last_updown_change);
                        str_printfa(str, "setting to state=%s vhosts=%u",