]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: When ring is synced, purge any pending "removed" directors
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 5 Oct 2017 09:34:10 +0000 (12:34 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Thu, 5 Oct 2017 14:28:48 +0000 (17:28 +0300)
This allows adding a director back to the ring without having to wait for 30
seconds.

src/director/director.c

index a7710d29d6c939a61b6f4cc82e4ce039d651c55c..1441cace4ccbbf2bfdfdede416e0ab3028ad4776 100644 (file)
@@ -44,6 +44,8 @@ const char *user_kill_state_names[USER_KILL_STATE_DELAY+1] = {
 static struct log_throttle *user_move_throttle;
 static struct log_throttle *user_kill_fail_throttle;
 
+static void director_hosts_purge_removed(struct director *dir);
+
 static const struct log_throttle_settings director_log_throttle_settings = {
        .throttle_at_max_per_interval = 100,
        .unthrottle_at_max_per_interval = 2,
@@ -346,6 +348,10 @@ void director_set_ring_synced(struct director *dir)
        timeout_remove(&dir->to_sync);
        dir->ring_synced = TRUE;
        dir->ring_last_sync_time = ioloop_time;
+       /* If there are any director hosts still marked as "removed", we can
+          safely remove those now. The entire director cluster knows about the
+          removal now. */
+       director_hosts_purge_removed(dir);
        mail_hosts_set_synced(dir->mail_hosts);
        director_set_state_changed(dir);
 }