History log of /dovecot/src/director/user-directory.h
Revision Date Author Comments Expand
14660f677e16a5c36f3c43e9e64f5e021fda627b 25-Nov-2017 Timo Sirainen <timo.sirainen@dovecot.fi>

director: Don't send USERs in handshake that were already sent between handshake If the user was refreshed since the handshake was started, it means that the same user was already sent to the other side (added to the stream immediately after it was received/handled). There's no need to send it again. This fixes a potentally infinite handshake when users are rapidly changing and the handshake iterator never sees the end of the list. (Each refreshed user is moved to the end of the list, so handshaking can keep sending the same user over and over again.)

b3e36790ca9e16d022118012b46ed50f73a45046 26-Nov-2017 Timo Sirainen <timo.sirainen@dovecot.fi>

director: Avoid USER loops when ring latency is over 1 second Do this by adding a timestamp parameter to USER events. This way if it takes over 1 second for the USER event to traverse the ring, it won't get into an infinite loop getting the user updated over and over again.

1a7ed931e58827e3048360be8341f29dfb85837b 08-Nov-2016 Aki Tuomi <aki.tuomi@dovecot.fi>

director: Code cleanup - typedef user_free_hook This is done because user_free_hook needs to be also used in mail_host. If it changes, this reduces the places that need touching.

de92873c366becfaea1554642f89b9169d7955e2 08-Nov-2016 Timo Sirainen <timo.sirainen@dovecot.fi>

director: Code cleanup - moved username_hash generation to director.h It's not really user_directory specific. This is especially important in the following patches that add per-tag user_directories. It's also not always known which tag the username_hash refers to, so there can't be different tag-specific username_hash generators.

0f5dc4da3982053036be65190e44bf28a67b1ca2 02-Nov-2016 Timo Sirainen <timo.sirainen@dovecot.fi>

lib: API change - var_expand*() now returns error string. This allows callers to fail properly if the format string is invalid.

/dovecot/src/auth/auth-cache.c /dovecot/src/auth/auth-policy.c /dovecot/src/auth/auth-request-var-expand.c /dovecot/src/auth/auth-request-var-expand.h /dovecot/src/auth/auth-request.c /dovecot/src/auth/db-checkpassword.c /dovecot/src/auth/db-dict.c /dovecot/src/auth/db-ldap.c /dovecot/src/auth/db-passwd-file.c /dovecot/src/auth/passdb-imap.c /dovecot/src/auth/passdb-ldap.c /dovecot/src/auth/passdb-pam.c /dovecot/src/auth/passdb-passwd-file.c /dovecot/src/auth/passdb-sql.c /dovecot/src/auth/passdb-static.c /dovecot/src/auth/passdb-template.c /dovecot/src/auth/passdb-template.h /dovecot/src/auth/test-auth-cache.c /dovecot/src/auth/test-auth-request-var-expand.c /dovecot/src/auth/userdb-dict.c /dovecot/src/auth/userdb-ldap.c /dovecot/src/auth/userdb-passwd-file.c /dovecot/src/auth/userdb-passwd.c /dovecot/src/auth/userdb-sql.c /dovecot/src/auth/userdb-static.c /dovecot/src/auth/userdb-template.c /dovecot/src/auth/userdb-template.h director-request.c director.c doveadm-connection.c notify-connection.c test-user-directory.c user-directory.c user-directory.h /dovecot/src/doveadm/doveadm-auth-server.c /dovecot/src/doveadm/doveadm-auth.c /dovecot/src/doveadm/doveadm-director.c /dovecot/src/doveadm/doveadm-dsync.c /dovecot/src/doveadm/doveadm-print-formatted.c /dovecot/src/imap-hibernate/imap-client.c /dovecot/src/imap-urlauth/imap-urlauth-worker.c /dovecot/src/imap/imap-client.c /dovecot/src/imap/main.c /dovecot/src/lda/main.c /dovecot/src/lib-lda/mail-deliver.c /dovecot/src/lib-lda/mail-send.c /dovecot/src/lib-mail/mail-user-hash.c /dovecot/src/lib-mail/mail-user-hash.h /dovecot/src/lib-settings/settings-parser.c /dovecot/src/lib-settings/settings-parser.h /dovecot/src/lib-sql/driver-cassandra.c /dovecot/src/lib-storage/index/shared/shared-storage.c /dovecot/src/lib-storage/mail-storage-service.c /dovecot/src/lib-storage/mail-user.c /dovecot/src/lib/test-var-expand.c /dovecot/src/lib/var-expand.c /dovecot/src/lib/var-expand.h /dovecot/src/lmtp/client.c /dovecot/src/lmtp/commands.c /dovecot/src/login-common/client-common.c /dovecot/src/login-common/login-proxy.c /dovecot/src/login-common/login-settings.c /dovecot/src/plugins/acl/acl-shared-storage.c /dovecot/src/plugins/dict-ldap/dict-ldap.c /dovecot/src/pop3/pop3-client.c /dovecot/src/pop3/pop3-commands.c
1b7cd57585d8c2f133dd612d2d5d9c775595659f 25-Oct-2016 Timo Sirainen <timo.sirainen@dovecot.fi>

director: Moved all user killing state to struct director_kill_context This should make it a bit easier to understand the life time of user killing. It also simplifies code by removing struct director_user_kill_finish_ctx. Finally, this already reduces memory usage with 32bit systems, and would make it possible to reduce also on 64bit systems if timestamp is shrank to 31 bits and weak bit moved after it. I'm not sure if that would be better for performance though. In any case it would provide free space for 4 extra bytes if that were needed in future.

79ee504bdf920f01e12e28f238799bf2616489df 25-Oct-2016 Timo Sirainen <timo.sirainen@dovecot.fi>

director: Code cleanup - added USER_IS_BEING_KILLED() macro

c13fce16374a6fa8d127742c527498d38e777789 25-Oct-2016 Timo Sirainen <timo.sirainen@dovecot.fi>

director: Code cleanup - move enum user_kill_state to director.h This will be needed by following commits

6af8cc0573832465c621bcd91634e15461e8bf58 25-Oct-2016 Timo Sirainen <timo.sirainen@dovecot.fi>

director: Execute director_flush_socket only from one director. Having each director do it would be redundant since they're all supposed to be performing the same flush task to the same backend.

f9c76559302e6485f59ab0e6050b76fd6d268fee 25-Oct-2016 Timo Sirainen <timo.sirainen@dovecot.fi>

director: Prevent race conditions by adding USER_KILL_STATE_FLUSHING In theory it's possible that a user is freed during a flush and added back before flush is finished, possibly even being moved again. This check makes sure that we don't finish such move unless we're actually at the correct flushing state. (If there's another flush also running for the user it'll be ignored.) This is also useful for logging purposes.

11ee3b40320a31669bd717fecbe1e332dad4fd84 25-Oct-2016 Timo Sirainen <timo.sirainen@dovecot.fi>

director: HOST-RESET-USERS moves users more slowly now. By default only 100 users can be moved in parallel. This can be overridden with HOST-RESET-USERS parameter. This delaying is especially useful when director_flush_socket is used to avoid huge floods to the script service. Even without the socket it's still good for avoiding unnecessary load spikes when all users are kicked at once and they reconnect back at the same time.

ade4a0e1a8f4bc3467f4fcff9c219558fe348abf 25-Oct-2016 Timo Sirainen <timo.sirainen@dovecot.fi>

director: Log user's kill_state with a human-readable string.

0dffa25d211be541ee3c953b23566a1a990789df 06-Jun-2016 Timo Sirainen <timo.sirainen@dovecot.fi>

global: unsigned int:1 -> bool:1 perl -i -pe 's/unsigned int ([^,:;]+):1;/bool $1:1;/' **/*.[ch]

/dovecot/src/anvil/anvil-connection.c /dovecot/src/anvil/penalty.c /dovecot/src/auth/auth-client-connection.h /dovecot/src/auth/auth-master-connection.h /dovecot/src/auth/auth-penalty.c /dovecot/src/auth/auth-postfix-connection.c /dovecot/src/auth/auth-request-handler.c /dovecot/src/auth/auth-request.h /dovecot/src/auth/auth-worker-client.c /dovecot/src/auth/auth-worker-server.c /dovecot/src/auth/db-checkpassword.c /dovecot/src/auth/db-passwd-file.h /dovecot/src/auth/db-sql.h /dovecot/src/auth/mech-digest-md5.c /dovecot/src/auth/passdb-pam.c /dovecot/src/auth/userdb-passwd.c /dovecot/src/auth/userdb-sql.c /dovecot/src/auth/userdb-static.c /dovecot/src/config/config-connection.c /dovecot/src/config/config-parser-private.h /dovecot/src/config/doveconf.c /dovecot/src/dict/dict-connection.h director-connection.c director-host.h director.h doveadm-connection.c login-connection.c mail-host.h user-directory.h /dovecot/src/doveadm/client-connection.h /dovecot/src/doveadm/doveadm-dsync.c /dovecot/src/doveadm/doveadm-mail-index.c /dovecot/src/doveadm/doveadm-mail-mailbox-status.c /dovecot/src/doveadm/doveadm-mail.h /dovecot/src/doveadm/doveadm-print-flow.c /dovecot/src/doveadm/doveadm-print-pager.c /dovecot/src/doveadm/doveadm-print-tab.c /dovecot/src/doveadm/doveadm-print-table.c /dovecot/src/doveadm/doveadm-stats.c /dovecot/src/doveadm/dsync/dsync-brain-private.h /dovecot/src/doveadm/dsync/dsync-ibc-private.h /dovecot/src/doveadm/dsync/dsync-ibc-stream.c /dovecot/src/doveadm/dsync/dsync-mailbox-export.c /dovecot/src/doveadm/dsync/dsync-mailbox-import.c /dovecot/src/doveadm/dsync/dsync-mailbox-tree.h /dovecot/src/doveadm/server-connection.c /dovecot/src/imap-login/imap-login-client.h /dovecot/src/imap-urlauth/imap-urlauth-client.h /dovecot/src/imap-urlauth/imap-urlauth-login.c /dovecot/src/imap-urlauth/imap-urlauth-worker.c /dovecot/src/imap/cmd-append.c /dovecot/src/imap/cmd-idle.c /dovecot/src/imap/cmd-list.c /dovecot/src/imap/cmd-select.c /dovecot/src/imap/cmd-urlfetch.c /dovecot/src/imap/imap-client.h /dovecot/src/imap/imap-fetch-body.c /dovecot/src/imap/imap-fetch.h /dovecot/src/imap/imap-notify.h /dovecot/src/imap/imap-search.h /dovecot/src/imap/imap-sync.c /dovecot/src/indexer/indexer-client.c /dovecot/src/indexer/indexer-queue.h /dovecot/src/indexer/master-connection.c /dovecot/src/indexer/worker-connection.c /dovecot/src/ipc/ipc-connection.h /dovecot/src/lib-auth/auth-client-private.h /dovecot/src/lib-auth/auth-master.c /dovecot/src/lib-auth/auth-master.h /dovecot/src/lib-auth/auth-server-connection.h /dovecot/src/lib-compression/istream-bzlib.c /dovecot/src/lib-compression/istream-lz4.c /dovecot/src/lib-compression/istream-lzma.c /dovecot/src/lib-compression/istream-zlib.c /dovecot/src/lib-compression/ostream-bzlib.c /dovecot/src/lib-compression/ostream-lzma.c /dovecot/src/lib-compression/ostream-zlib.c /dovecot/src/lib-dict/dict-client.c /dovecot/src/lib-dict/dict-private.h /dovecot/src/lib-dict/dict-sql.c /dovecot/src/lib-fs/fs-api-private.h /dovecot/src/lib-http/http-client-private.h /dovecot/src/lib-http/http-header-parser.c /dovecot/src/lib-http/http-message-parser.h /dovecot/src/lib-http/http-request-parser.c /dovecot/src/lib-http/http-request.h /dovecot/src/lib-http/http-response.h /dovecot/src/lib-http/http-server-private.h /dovecot/src/lib-http/http-transfer-chunked.c /dovecot/src/lib-http/http-url.c /dovecot/src/lib-http/http-url.h /dovecot/src/lib-imap-client/imapc-connection.c /dovecot/src/lib-imap-storage/imap-metadata.c /dovecot/src/lib-imap-storage/imap-msgpart-url.c /dovecot/src/lib-imap-storage/imap-msgpart.c /dovecot/src/lib-imap-urlauth/imap-urlauth-connection.c /dovecot/src/lib-imap-urlauth/imap-urlauth-fetch.c /dovecot/src/lib-imap-urlauth/imap-urlauth-fetch.h /dovecot/src/lib-imap-urlauth/imap-urlauth-private.h /dovecot/src/lib-imap/imap-arg.h /dovecot/src/lib-imap/imap-parser.c /dovecot/src/lib-imap/imap-url.c /dovecot/src/lib-imap/imap-url.h /dovecot/src/lib-index/mail-cache-private.h /dovecot/src/lib-index/mail-cache-transaction.c /dovecot/src/lib-index/mail-index-private.h /dovecot/src/lib-index/mail-index-strmap.c /dovecot/src/lib-index/mail-index-sync-private.h /dovecot/src/lib-index/mail-index-sync.c /dovecot/src/lib-index/mail-index-transaction-private.h /dovecot/src/lib-index/mail-index-view-private.h /dovecot/src/lib-index/mail-index-view-sync.c /dovecot/src/lib-index/mail-index.h /dovecot/src/lib-index/mail-transaction-log-private.h /dovecot/src/lib-index/mail-transaction-log-view-private.h /dovecot/src/lib-index/mail-transaction-log.h /dovecot/src/lib-lda/duplicate.c /dovecot/src/lib-lda/lmtp-client.c /dovecot/src/lib-mail/istream-binary-converter.c /dovecot/src/lib-mail/istream-dot.c /dovecot/src/lib-mail/istream-header-filter.c /dovecot/src/lib-mail/message-decoder.c /dovecot/src/lib-mail/message-header-decode.c /dovecot/src/lib-mail/message-header-parser.c /dovecot/src/lib-mail/message-header-parser.h /dovecot/src/lib-mail/message-parser.c /dovecot/src/lib-mail/message-search.c /dovecot/src/lib-master/ipc-server.c /dovecot/src/lib-master/master-instance.c /dovecot/src/lib-master/master-login-auth.c /dovecot/src/lib-master/master-login.c /dovecot/src/lib-master/master-login.h /dovecot/src/lib-master/master-service-private.h /dovecot/src/lib-master/master-service-settings-cache.c /dovecot/src/lib-master/master-service-settings.h /dovecot/src/lib-master/master-service.h /dovecot/src/lib-master/service-settings.h /dovecot/src/lib-sql/driver-cassandra.c /dovecot/src/lib-sql/driver-mysql.c /dovecot/src/lib-sql/driver-pgsql.c /dovecot/src/lib-sql/driver-sqlite.c /dovecot/src/lib-sql/sql-api-private.h /dovecot/src/lib-ssl-iostream/iostream-openssl.h /dovecot/src/lib-storage/index/cydir/cydir-save.c /dovecot/src/lib-storage/index/dbox-common/dbox-file.h /dovecot/src/lib-storage/index/dbox-common/dbox-save.h /dovecot/src/lib-storage/index/dbox-multi/mdbox-map-private.h /dovecot/src/lib-storage/index/dbox-multi/mdbox-map.c /dovecot/src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c /dovecot/src/lib-storage/index/dbox-multi/mdbox-storage.h /dovecot/src/lib-storage/index/imapc/imapc-list.h /dovecot/src/lib-storage/index/imapc/imapc-save.c /dovecot/src/lib-storage/index/imapc/imapc-storage.h /dovecot/src/lib-storage/index/imapc/imapc-sync.h /dovecot/src/lib-storage/index/index-mail.h /dovecot/src/lib-storage/index/index-rebuild.h /dovecot/src/lib-storage/index/index-search-private.h /dovecot/src/lib-storage/index/index-search.c /dovecot/src/lib-storage/index/index-sort-string.c /dovecot/src/lib-storage/index/index-thread-finish.c /dovecot/src/lib-storage/index/index-thread-private.h /dovecot/src/lib-storage/index/index-thread.c /dovecot/src/lib-storage/index/istream-mail.c /dovecot/src/lib-storage/index/maildir/maildir-copy.c /dovecot/src/lib-storage/index/maildir/maildir-keywords.c /dovecot/src/lib-storage/index/maildir/maildir-save.c /dovecot/src/lib-storage/index/maildir/maildir-storage.h /dovecot/src/lib-storage/index/maildir/maildir-sync.c /dovecot/src/lib-storage/index/maildir/maildir-uidlist.c /dovecot/src/lib-storage/index/mbox/istream-raw-mbox.c /dovecot/src/lib-storage/index/mbox/mbox-save.c /dovecot/src/lib-storage/index/mbox/mbox-storage.h /dovecot/src/lib-storage/index/mbox/mbox-sync-private.h /dovecot/src/lib-storage/index/pop3c/pop3c-client.c /dovecot/src/lib-storage/index/pop3c/pop3c-storage.h /dovecot/src/lib-storage/index/raw/raw-storage.h /dovecot/src/lib-storage/list/mailbox-list-fs-iter.c /dovecot/src/lib-storage/list/mailbox-list-index-notify.c /dovecot/src/lib-storage/list/mailbox-list-index-sync.h /dovecot/src/lib-storage/list/mailbox-list-index.h /dovecot/src/lib-storage/list/mailbox-list-iter.c /dovecot/src/lib-storage/list/mailbox-list-none.c /dovecot/src/lib-storage/mail-namespace.h /dovecot/src/lib-storage/mail-search-register.c /dovecot/src/lib-storage/mail-search.h /dovecot/src/lib-storage/mail-storage-private.h /dovecot/src/lib-storage/mail-storage-service.c /dovecot/src/lib-storage/mail-storage-service.h /dovecot/src/lib-storage/mail-storage.h /dovecot/src/lib-storage/mail-user.h /dovecot/src/lib-storage/mailbox-list-private.h /dovecot/src/lib-storage/mailbox-search-result-private.h /dovecot/src/lib-storage/mailbox-tree.c /dovecot/src/lib/buffer.c /dovecot/src/lib/connection.h /dovecot/src/lib/file-dotlock.c /dovecot/src/lib/file-dotlock.h /dovecot/src/lib/ioloop-private.h /dovecot/src/lib/istream-crlf.c /dovecot/src/lib/istream-file-private.h /dovecot/src/lib/istream-jsonstr.c /dovecot/src/lib/istream-mmap.c /dovecot/src/lib/istream-private.h /dovecot/src/lib/istream-tee.c /dovecot/src/lib/istream.h /dovecot/src/lib/mempool.h /dovecot/src/lib/module-dir.h /dovecot/src/lib/ostream-file-private.h /dovecot/src/lib/ostream-private.h /dovecot/src/lib/ostream.h /dovecot/src/lmtp/client.h /dovecot/src/lmtp/lmtp-proxy.c /dovecot/src/log/log-connection.c /dovecot/src/login-common/client-common.h /dovecot/src/login-common/login-proxy.c /dovecot/src/login-common/ssl-proxy-openssl.c /dovecot/src/master/service-process.h /dovecot/src/master/service.h /dovecot/src/plugins/acl/acl-api-private.h /dovecot/src/plugins/acl/acl-api.h /dovecot/src/plugins/acl/acl-backend-vfile.h /dovecot/src/plugins/acl/acl-lookup-dict.c /dovecot/src/plugins/acl/acl-mailbox-list.c /dovecot/src/plugins/expire/expire-plugin.c /dovecot/src/plugins/fts-lucene/fts-backend-lucene.c /dovecot/src/plugins/fts-solr/fts-backend-solr.c /dovecot/src/plugins/fts-solr/solr-connection.c /dovecot/src/plugins/fts-squat/squat-trie-private.h /dovecot/src/plugins/fts-squat/squat-trie.c /dovecot/src/plugins/fts-squat/squat-uidlist.c /dovecot/src/plugins/fts/fts-api-private.h /dovecot/src/plugins/fts/fts-indexer.c /dovecot/src/plugins/fts/fts-storage.c /dovecot/src/plugins/fts/fts-storage.h /dovecot/src/plugins/lazy-expunge/lazy-expunge-plugin.c /dovecot/src/plugins/pop3-migration/pop3-migration-plugin.c /dovecot/src/plugins/quota/quota-fs.c /dovecot/src/plugins/quota/quota-maildir.c /dovecot/src/plugins/quota/quota-private.h /dovecot/src/plugins/quota/quota-storage.c /dovecot/src/plugins/virtual/virtual-mail.c /dovecot/src/plugins/virtual/virtual-storage.h /dovecot/src/plugins/virtual/virtual-sync.c /dovecot/src/pop3/pop3-client.h /dovecot/src/replication/replicator/dsync-client.c /dovecot/src/replication/replicator/notify-connection.c /dovecot/src/replication/replicator/replicator-brain.c /dovecot/src/replication/replicator/replicator-queue.h
5c1733e9e572e242598b8b2f12a0068897caf5b7 15-May-2015 Timo Sirainen <tss@iki.fi>

director: Moving a user to another host sometimes caused the move to fail. It could have given "User hash .. is being redirected to two hosts" error and afterwards moved the user back to its original host.

ece0a20249ce26208db3415ba2e79423678856f8 13-May-2015 Timo Sirainen <tss@iki.fi>

director: Include useful statistics in process title.

8621be3846dc097420cce325ad36d1b646f72a09 29-Jul-2013 Timo Sirainen <tss@iki.fi>

director: Update existing users' timestamps during handshake.

32a93320fd2b6ada5ac8027166819463c1a007b6 20-Apr-2012 Timo Sirainen <tss@iki.fi>

director: Removed special (time_t)-1 code, it's not actually needed. Also this fixes a user refreshing issue.

447bf65ddb82ec279e7386828748ef47e199a6af 19-Apr-2012 Timo Sirainen <tss@iki.fi>

director: Optimized adding users to linked list during handshake.

b6b9c99fefbbc662bd9a0006566133c4480bf0e8 08-Mar-2012 Timo Sirainen <tss@iki.fi>

director: Avoid user getting redirected to different servers near its expiration. Fixes a problem when user is logging in at the same time on director1 which thinks the user is expired, and on director2 which thinks the user expires only in 1 second.

5733207dc3ec10e6e5a6e0a8b30fbd1b061062b9 05-Mar-2012 Timo Sirainen <tss@iki.fi>

Added director_username_hash setting to specify what part of the username is hashed. The default is "%u" meaning the full username. Another potentially useful value is "%d" for hashing only the domain (i.e. redirect users from the same domain always to same server so they can safely access each others' shared mailboxes).

15ab2452b0220a115f4351ad9d7fd5ec70ae7966 23-May-2011 Timo Sirainen <tss@iki.fi>

director: Added support for moving user to another server with "doveadm director move".

2670cd577aa57eb9f915a4f4220ae48c9b4fc5fb 19-May-2010 Timo Sirainen <tss@iki.fi>

Added initial implementation of a director process (for NFS users). There are still some unimplemented features and bugs. Also changing mail server list doesn't yet make sure that other directors won't assign the same user to a different server at the same time. --HG-- branch : HEAD