From: Timo Sirainen Date: Thu, 5 Oct 2017 09:34:10 +0000 (+0300) Subject: director: When ring is synced, purge any pending "removed" directors X-Git-Tag: 2.3.0.rc1~895 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb5809d0666810ff5ba9da188e1e4e2092ee0eea;p=thirdparty%2Fdovecot%2Fcore.git director: When ring is synced, purge any pending "removed" directors This allows adding a director back to the ring without having to wait for 30 seconds. --- diff --git a/src/director/director.c b/src/director/director.c index a7710d29d6..1441cace4c 100644 --- a/src/director/director.c +++ b/src/director/director.c @@ -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); }