Timo Sirainen [Thu, 21 Sep 2017 14:53:04 +0000 (17:53 +0300)]
master: Don't throttle services that are already being destroyed
If process couldn't be created, because the service_list is already being
destroyed (e.g. due to reload), also don't enable unnecessary throttling
for the service.
Hopefully fixes these random errors that are logged alone:
master: Error: service(...): command startup failed, throttling for 2 secs
Stephan Bosch [Wed, 20 Sep 2017 22:38:33 +0000 (00:38 +0200)]
lib-http: client: Send empty payload (Content-Length: 0) for requests that normally expect a payload.
This includes the standard POST and PUT methods.
Others need to use the new http_client_request_set_payload_empty() function to force sending an empty payload.
Timo Sirainen [Tue, 19 Sep 2017 08:18:30 +0000 (11:18 +0300)]
lib-storage: Fail if two namespaces try to wrongly share the same LISTINDEX
If they have different mailboxes-path, they can't be sharing the same
mailbox list index. The previous behavior caused Dovecot to silently
overwrite the list index whenever each of the namespaces were accessed,
resulting in bad performance.
Timo Sirainen [Mon, 18 Sep 2017 20:04:55 +0000 (23:04 +0300)]
notify-status: Remove first_unseen_seq field
The sequence number keeps changing, so it's very unlikely to be useful.
It's also not always as efficiently available as the other fields, so
better to avoid having it.
Unless the caller explicitly cleared the parser's memory, allow_pct_nul was
somewhat random. All the code in Dovecot core did this, but some plugins
didn't.
Timo Sirainen [Thu, 14 Sep 2017 14:57:29 +0000 (17:57 +0300)]
director: After CONNECT was received, make sure we disconnect
The remote side won't be reading anything after the CONNECT, so we have to
disconnect anyway. If we decide that the CONNECT request is wrong, reconnect
after a short delay and hope that the remote agrees with us the next time.
Timo Sirainen [Thu, 14 Sep 2017 14:38:24 +0000 (17:38 +0300)]
director: Don't reset directors' last_network_failure while handshaking
The reset is done mainly to make it faster for a director that has been down
to connect back to the ring, without other directors still thinking that
it's down. But DIRECTOR that is sent during handshake says nothing about
whether the director is up at the moment or not.
Timo Sirainen [Wed, 13 Sep 2017 12:16:59 +0000 (15:16 +0300)]
cassandra: Fix paged queries to work again
When continuing the result, consistency was reset to 0 (=ANY), which caused
the queries to fail. There's no need to initialize the statement again when
continuing it. Also set result->consistency to be correct mainly for
debugging purposes.
Timo Sirainen [Mon, 11 Sep 2017 09:27:17 +0000 (12:27 +0300)]
lib-storage: Fix mailbox list notification assert-crash when mailbox is deleted
Reproduced with if IMAP NOTIFY is used for non-selected mailboxes without
MailboxName being specified. Another session then does changes to a
mailbox and immediately deletes it, which causes the crash.
Fixes:
Panic: file mailbox-list-index-notify.c: line 751: unreached
Timo Sirainen [Mon, 11 Sep 2017 10:54:12 +0000 (13:54 +0300)]
lib-storage: Avoid unnecessary stat()s in mailbox list index notifications
If mailbox list gets a notification there's no need to stat() the INBOX, and
vice versa. Also if the notification was already seen and a callback timeout
set, there's no need to keep stat()ing.
Timo Sirainen [Mon, 11 Sep 2017 10:48:17 +0000 (13:48 +0300)]
lib-storage: Make sure mailbox list notification flush sees latest changes.
This is mainly useful with imaptest test scripts to make sure they're seeing
the changes done by the other session, without assuming that inotify will
always notify about the change before NOOP is run (it doesn't).
Do this only if mailbox_idle_check_interval>0, so it's not run when periodic
stat()s are wanted to be avoided.
Timo Sirainen [Fri, 8 Sep 2017 09:20:21 +0000 (12:20 +0300)]
lib-storage: Preserve messages' vsize record when rebuilding index
Since vsize is often used by quota, losing this can be very expensive.
If the vsize is wrong, it gets fixed automatically when fetching the
message body.
Timo Sirainen [Thu, 24 Aug 2017 08:13:32 +0000 (11:13 +0300)]
cassandra: sql_transaction_commit_s() - Set query_type correctly
The queries were all sent with READ type instead of WRITE/DELETE. This
meant they were using potentially wrong consistency values. Although
synchronous commits aren't actually used anywhere, so this practically
this doesn't fix anything right now.
Timo Sirainen [Thu, 7 Sep 2017 12:40:16 +0000 (15:40 +0300)]
dict-sql: Use prepared statements
Create a hash table of query template -> prepared statement and fill it out
as needed. This could have been done some alternative ways that wouldn't
require building the string first, but this should still be fast enough and
much easier to implement.
Timo Sirainen [Tue, 15 Aug 2017 13:50:16 +0000 (16:50 +0300)]
dict-sql: Cleanup - Remove unnecessary code
The values are explicitly added to params. sql_dict_update_query() doesn't
add them again. Since the "diff" parameter is already a long long type,
this avoids unnecessary conversion to string and back.