dovecot-2.2: director: With director_consistent_hashing=yes host...

dovecot at dovecot.org dovecot at dovecot.org
Tue Nov 24 09:15:56 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/63516762a64c
changeset: 19406:63516762a64c
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Nov 23 19:35:03 2015 +0200
description:
director: With director_consistent_hashing=yes hosts_hash wasn't always calculated right.
If different servers had added hosts in different order, the hosts_hash
would have become different, which caused errors and resyncs.

diffstat:

 src/director/mail-host.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 194e3622d5e6 -r 63516762a64c src/director/mail-host.c
--- a/src/director/mail-host.c	Wed Nov 18 16:33:26 2015 +0200
+++ b/src/director/mail-host.c	Mon Nov 23 19:35:03 2015 +0200
@@ -99,8 +99,6 @@
 	struct mail_host *const *hostp;
 	unsigned int i;
 
-	array_sort(&list->hosts, mail_host_cmp);
-
 	/* rebuild vhosts */
 	array_clear(&list->vhosts);
 	array_foreach(&list->hosts, hostp) {
@@ -119,6 +117,8 @@
 	struct mail_host *const *hostp;
 	uint32_t num;
 
+	array_sort(&list->hosts, mail_host_cmp);
+
 	if (list->consistent_hashing)
 		mail_hosts_sort_ring(list);
 	else


More information about the dovecot-cvs mailing list