If different servers had added hosts in different order, the hosts_hash
would have become different, which caused errors and resyncs.
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) {
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