return TRUE;
}
+ /* If directors got disconnected while we were waiting a SYNC reply,
+ it might have gotten lost. If we've received a DIRECTOR update since
+ the last time we sent a SYNC, retry sending it here to make sure
+ it doesn't get stuck. We don't want to do this too eagerly because
+ it may trigger desynced_hosts_hash != hosts_hash mismatch, which
+ causes unnecessary error logging and hosts-resending. */
if ((host == NULL || !host->self) &&
+ dir->last_sync_sent_ring_change_counter != dir->ring_change_counter &&
(time_t)dir->self_host->last_sync_timestamp != ioloop_time)
(void)director_resend_sync(dir);
return TRUE;
{
string_t *str;
+ if (host == dir->self_host)
+ dir->last_sync_sent_ring_change_counter = dir->ring_change_counter;
+
str = t_str_new(128);
str_printfa(str, "SYNC\t%s\t%u\t%u",
net_ip2addr(&host->ip), host->port, seq);
{
const char *cmd;
+ added_host->dir->ring_change_counter++;
cmd = t_strdup_printf("DIRECTOR\t%s\t%u\n",
net_ip2addr(&added_host->ip), added_host->port);
director_update_send(added_host->dir, src, cmd);
struct ipc_client *ipc_proxy;
unsigned int sync_seq;
+ unsigned int ring_change_counter;
+ unsigned int last_sync_sent_ring_change_counter;
/* the lowest minor version supported by the ring */
unsigned int ring_min_version;
time_t ring_last_sync_time;