Mercurial > dovecot > core-2.2
diff src/director/login-connection.c @ 18067:a7e830b9b967
director: Added support for backend cluster "tags".
This allows using a single director ring for multiple backend clusters. By
default everything has an empty tag. A passdb lookup can return
"director_tag" field containing the wanted tag name. If there aren't any
backend servers with the wanted tag, it's treated the same as if there
aren't any backend servers available (= wait for 30 secs for a backend and
then return temporary failure).
Tags can be added to configuration by adding @tag suffix to IPs/hosts. For
example:
director_mail_servers = 10.0.0.100-10.0.0.110@name1 10.0.0.120@name2
"doveadm director add" can also add tags either with @tag suffix or with -t
parameter. "doveadm director status user@domain" requires giving the user's
correct tag with -t parameter or the results won't be correct (empty tag's
results are shown). Tags can't currently be changed for an existing host
without removing it first.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 12 Nov 2014 06:58:37 +0200 |
parents | 899cf87a687c |
children | 3009a1a6f6d5 |
line wrap: on
line diff
--- a/src/director/login-connection.c Wed Nov 12 06:46:45 2014 +0200 +++ b/src/director/login-connection.c Wed Nov 12 06:58:37 2014 +0200 @@ -109,7 +109,7 @@ { struct login_connection *conn = context; struct login_host_request *request; - const char *const *args, *line_params, *username = NULL; + const char *const *args, *line_params, *username = NULL, *tag = ""; bool proxy = FALSE, host = FALSE; if (line == NULL) { @@ -142,6 +142,8 @@ host = TRUE; else if (strncmp(*args, "destuser=", 9) == 0) username = *args + 9; + else if (strncmp(*args, "director_tag=", 13) == 0) + tag = *args + 13; else if (strncmp(*args, "user=", 5) == 0) { if (username == NULL) username = *args + 5; @@ -165,7 +167,7 @@ request->username = i_strdup(username); conn->refcount++; - director_request(conn->dir, username, login_host_callback, request); + director_request(conn->dir, username, tag, login_host_callback, request); } struct login_connection *