dovecot-2.2: director: Use mail_hosts_hash() to improve debug lo...

dovecot at dovecot.org dovecot at dovecot.org
Mon Oct 12 12:43:44 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/bae8efd8b5b3
changeset: 19292:bae8efd8b5b3
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Oct 12 15:41:55 2015 +0300
description:
director: Use mail_hosts_hash() to improve debug log messages.

diffstat:

 src/director/director-connection.c |  13 ++++++++++---
 src/director/director-request.c    |   5 +++--
 src/director/director.c            |  11 +++++++++--
 3 files changed, 22 insertions(+), 7 deletions(-)

diffs (80 lines):

diff -r eb9b9519db7a -r bae8efd8b5b3 src/director/director-connection.c
--- a/src/director/director-connection.c	Mon Oct 12 15:41:25 2015 +0300
+++ b/src/director/director-connection.c	Mon Oct 12 15:41:55 2015 +0300
@@ -882,7 +882,7 @@
 		update = host->vhost_count != vhost_count ||
 			host->down != down ||
 			host->last_updown_change != last_updown_change;
-;
+
 		if (strcmp(tag, host->tag) != 0) {
 			i_error("director(%s): Host %s changed tag from '%s' to '%s'",
 				conn->name, net_ip2addr(&host->ip),
@@ -915,6 +915,12 @@
 		mail_host_set_vhost_count(conn->dir->mail_hosts,
 					  host, vhost_count);
 		director_update_host(conn->dir, src_host, dir_host, host);
+	} else {
+		dir_debug("Ignoring host %s update vhost_count=%u "
+			  "down=%d last_updown_change=%ld (hosts_hash=%u)",
+			  net_ip2addr(&ip), vhost_count, down,
+			  (long)last_updown_change,
+			  mail_hosts_hash(conn->dir->mail_hosts));
 	}
 	return TRUE;
 }
@@ -1263,8 +1269,9 @@
 			/* duplicate SYNC (which was sent just in case the
 			   previous one got lost) */
 		} else {
-			dir_debug("Ring is synced (%s sent seq=%u)",
-				  conn->name, seq);
+			dir_debug("Ring is synced (%s sent seq=%u, hosts_hash=%u)",
+				  conn->name, seq,
+				  mail_hosts_hash(dir->mail_hosts));
 			director_set_ring_synced(dir);
 		}
 	} else {
diff -r eb9b9519db7a -r bae8efd8b5b3 src/director/director-request.c
--- a/src/director/director-request.c	Mon Oct 12 15:41:25 2015 +0300
+++ b/src/director/director-request.c	Mon Oct 12 15:41:55 2015 +0300
@@ -308,8 +308,9 @@
 		}
 		user = user_directory_add(dir->users, request->username_hash,
 					  host, ioloop_time);
-		dir_debug("request: %u added timeout to %u",
-			  request->username_hash, user->timestamp);
+		dir_debug("request: %u added timeout to %u (hosts_hash=%u)",
+			  request->username_hash, user->timestamp,
+			  mail_hosts_hash(dir->mail_hosts));
 	}
 
 	i_assert(!user->weak);
diff -r eb9b9519db7a -r bae8efd8b5b3 src/director/director.c
--- a/src/director/director.c	Mon Oct 12 15:41:25 2015 +0300
+++ b/src/director/director.c	Mon Oct 12 15:41:55 2015 +0300
@@ -289,8 +289,9 @@
 		timeout_remove(&dir->to_handshake_warning);
 	if (dir->ring_handshake_warning_sent) {
 		i_warning("Ring is synced, continuing delayed requests "
-			  "(syncing took %d secs)",
-			  (int)(ioloop_time - dir->ring_last_sync_time));
+			  "(syncing took %d secs, hosts_hash=%u)",
+			  (int)(ioloop_time - dir->ring_last_sync_time),
+			  mail_hosts_hash(dir->mail_hosts));
 		dir->ring_handshake_warning_sent = FALSE;
 	}
 
@@ -523,6 +524,12 @@
 	/* update state in case this is the first mail host being added */
 	director_set_state_changed(dir);
 
+	dir_debug("Updating host %s vhost_count=%u "
+		  "down=%d last_updown_change=%ld (hosts_hash=%u)",
+		  net_ip2addr(&host->ip), host->vhost_count, host->down,
+		  (long)host->last_updown_change,
+		  mail_hosts_hash(dir->mail_hosts));
+
 	if (orig_src == NULL) {
 		orig_src = dir->self_host;
 		orig_src->last_seq++;


More information about the dovecot-cvs mailing list