]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Use mail_hosts_hash() to improve debug log messages.
authorTimo Sirainen <tss@iki.fi>
Mon, 12 Oct 2015 12:41:55 +0000 (15:41 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 12 Oct 2015 12:41:55 +0000 (15:41 +0300)
src/director/director-connection.c
src/director/director-request.c
src/director/director.c

index 745ad73434c8e6a502bd4e9a2b8f8e7fcc5ad3a5..8b0e9ce9cb936e5d8304cc75551d83ca0c6060c3 100644 (file)
@@ -882,7 +882,7 @@ director_cmd_host_int(struct director_connection *conn, const char *const *args,
                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 @@ director_cmd_host_int(struct director_connection *conn, const char *const *args,
                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 @@ director_connection_sync_host(struct director_connection *conn,
                        /* 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 {
index 3fd8a659931946c6528c23c6260befdeecacdace..0f7acfb281d2f19abd0ee7ab17c18de50ffa664b 100644 (file)
@@ -308,8 +308,9 @@ bool director_request_continue(struct director_request *request)
                }
                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);
index f7465b48238ec49189d6a493f1efe871dab8c6a2..a36a8cfe333c30ced2d39b790bb3a3bb1fc210b5 100644 (file)
@@ -289,8 +289,9 @@ void director_set_ring_synced(struct director *dir)
                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 @@ void director_update_host(struct director *dir, struct director_host *src,
        /* 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++;