Mercurial > dovecot > core-2.2
changeset 22575:33ced9ab0572
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.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Thu, 05 Oct 2017 12:34:10 +0300 |
parents | 7829235b8ac6 |
children | 707ae9de3812 |
files | src/director/director.c |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/director/director.c Tue Oct 03 16:40:32 2017 +0300 +++ b/src/director/director.c Thu Oct 05 12:34:10 2017 +0300 @@ -43,6 +43,8 @@ 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, @@ -354,6 +356,10 @@ 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); } @@ -510,7 +516,8 @@ struct director_host *const *hosts, *host; unsigned int i, count; - timeout_remove(&dir->to_remove_dirs); + if (dir->to_remove_dirs != NULL) + timeout_remove(&dir->to_remove_dirs); hosts = array_get(&dir->dir_hosts, &count); for (i = 0; i < count; ) {