[Dovecot] Quota Calculation seems to be wrong when using dsync
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Recently I encountered odd quota increases when using 'dsync' with the latest and greatest: 2.0.8 (89936539e3b8).
Say you got something in place like this:
plugin { quota = dict:user::file:%h/mdbox/dovecot-quota quota_rule = *:storage=1GB quota_rule2 = Trash:storage=+10%% }
Kick off a manual backup:
$ dsync -u user@domain.tld backup mdbox:/<path to backup>/mdbox
This results in doubling the quota for the backed up user. It doesn't seem to matter whether 'mirror' or 'backup' mode is used, both increase the "source" quota. Doesn't sound right to me. You can only get to the "real" usage by running a recalc manually:
$ doveadm quota recalc -u user@domain.tld
Anyone else seen this?
Regards Thomas
P.S. Merry Christmas -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
iEYEARECAAYFAk0VtH8ACgkQ+meF/S97aXjUkwCfdZFpUPCOY9UiukT+G68jCHHr mmMAnRHz56BXMzpC84CIYvUn4KHpl8OA =M0AZ -----END PGP SIGNATURE-----
On Sat, 2010-12-25 at 10:08 +0100, Thomas Leuxner wrote:
plugin { quota = dict:user::file:%h/mdbox/dovecot-quota quota_rule = *:storage=1GB quota_rule2 = Trash:storage=+10%% }
Kick off a manual backup:
$ dsync -u user@domain.tld backup mdbox:/<path to backup>/mdbox
This results in doubling the quota for the backed up user.
This is problematic. With dict quota you'll have this problem, because both source and destination uses the same file. So it would kind of make sense to disable quota for the destination dsync.. Except with Maildir++ the quota is stored in the Maildir root directory. There are no problems with dsyncing it, and you most likely wouldn't want quota disabled there.
So .. I'm not really sure what I can do about this. There are some workarounds you could do, like:
dsync -u user@domain.tld backup dsync -o mail=mdbox:/<path to backup>/mdbox -o plugin/quota=
(works only with latest 2.0/2.1 hg, but with older versions you could do e.g. -o mail_plugins=)
Still, it would be nice if there was some generic solution to this. Perhaps the destination username should be something different, like "backup". In dict-sql case then it would modify "backup" user's quota. For dict-file the %h could maybe expand to backup user's homedir.. The backup username probably should be a parameter to dsync I guess.. But an extra parameter wouldn't fix this automatically..
Am 09.02.2012 um 19:24 schrieb Timo Sirainen:
So .. I'm not really sure what I can do about this. There are some workarounds you could do, like:
dsync -u user@domain.tld backup dsync -o mail=mdbox:/<path to backup>/mdbox -o plugin/quota=
Thanks tried this morning. I think it has some issues with options and crashes without options :/
$ doveadm backup -u tlx@leuxner.net mdbox:/tmp/tlx/mdbox -o plugin/quota= backup: invalid option -- 'o' doveadm backup [-u <user>|-A] [-S <socket_path>] [-fR] [-m <mailbox>] <dest>
$ doveadm backup -u tlx@leuxner.net mdbox:/tmp/tlx/mdbox dsync(tlx@leuxner.net): Panic: file dsync-worker-local.c: line 1643 (local_worker_save_msg_continue): assertion failed: (ret == -1) dsync(tlx@leuxner.net): Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(+0x43c9a) [0x7f29e7fbec9a] -> /usr/lib/dovecot/libdovecot.so.0(default_fatal_handler+0x32) [0x7f29e7fbed82] -> /usr/lib/dovecot/libdovecot.so.0(i_error+0) [0x7f29e7f963af] -> doveadm() [0x428c6a] -> doveadm() [0x428dd1] -> doveadm(dsync_worker_msg_save+0x99) [0x428299] -> doveadm() [0x423e85] -> doveadm() [0x4287bb] -> doveadm() [0x4289b8] -> doveadm(dsync_worker_msg_get+0x56) [0x427ea6] -> doveadm() [0x423c5e] -> doveadm(dsync_brain_msg_sync_more+0x2a4) [0x423524] -> doveadm(dsync_brain_sync+0x4b9) [0x421df9] -> doveadm() [0x422c79] -> doveadm(dsync_brain_sync+0x7fd) [0x42213d] -> doveadm() [0x422b0c] -> doveadm(dsync_brain_sync+0x63e) [0x421f7e] -> doveadm(dsync_brain_sync_all+0x18) [0x4229e8] -> doveadm() [0x4204b0] -> doveadm() [0x40f346] -> doveadm(doveadm_mail_single_user+0x59) [0x40f3f9] -> doveadm() [0x40f646] -> doveadm(doveadm_mail_try_run+0x141) [0x40fa91] -> doveadm(main+0x391) [0x415de1] -> /lib/libc.so.6(__libc_start_main+0xfd) [0x7f29e7c37c8d] -> doveadm() [0x40ec59] Aborted
$ dovecot --version 2.1.rc5 (a927b41bf699)
Am 11.02.2012 um 08:58 schrieb Thomas Leuxner:
$ doveadm backup -u tlx@leuxner.net mdbox:/tmp/tlx/mdbox dsync(tlx@leuxner.net): Panic: file dsync-worker-local.c: line 1643 (local_worker_save_msg_continue): assertion failed: (ret == -1) dsync(tlx@leuxner.net): Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(+0x43c9a) [0x7f29e7fbec9a] -> /usr/lib/dovecot/libdovecot.so.0(default_fatal_handler+0x32) [0x7f29e7fbed82] -> /usr/lib/dovecot/libdovecot.so.0(i_error+0) [0x7f29e7f963af] -> doveadm() [0x428c6a] -> doveadm() [0x428dd1] -> doveadm(dsync_worker_msg_save+0x99) [0x428299] -> doveadm() [0x423e85] -> doveadm() [0x4287bb] -> doveadm() [0x4289b8] -> doveadm(dsync_worker_msg_get+0x56) [0x427ea6] -> doveadm() [0x423c5e] -> doveadm(dsync_brain_msg_sync_more+0x2a4) [0x423524] -> doveadm(dsync_brain_sync+0x4b9) [0x421df9] -> doveadm() [0x422c79] -> doveadm(dsync_brain_sync+0x7fd) [0x42213d] -> doveadm() [0x422b0c] -> doveadm(dsync_brain_sync+0x63e) [0x421f7e] -> doveadm(dsync_brain_sync_all+0x18) [0x4229e8] -> doveadm() [0x4204b0] -> doveadm() [0x40f346] -> doveadm(doveadm_mail_single_user+0x59) [0x40f3f9] -> doveadm() [0x40f646] -> doveadm(doveadm_mail_try_run+0x141) [0x40fa91] -> doveadm(main+0x391) [0x415de1] -> /lib/libc.so.6(__libc_start_main+0xfd) [0x7f29e7c37c8d] -> doveadm() [0x40ec59] Aborted
After having some coffee, above was inflicted by having insufficient disk space. Shouldn't crash anyway I guess.
$ dovecot --version 2.1.rc5 (a927b41bf699)
Some more coffee later revealed doveadm/dsync being picky on the order of parameters. This works:
$ doveadm -o plugin/quota= backup -u tlx@leuxner.net mdbox:/home/tlx/mdbox $ doveadm -f table quota get -u tlx@leuxner.net
Please look into the crash though.
Regards Thomas
On 11.2.2012, at 12.59, Thomas Leuxner wrote:
Some more coffee later revealed doveadm/dsync being picky on the order of parameters. This works:
$ doveadm -o plugin/quota= backup -u tlx@leuxner.net mdbox:/home/tlx/mdbox
Now you have disabled quota entirely from dsync. I guess it doesn't matter in this case though, since the source mailboxes aren't modified. Anyway, my original command would have worked also, you just modified it..
Am 12.02.2012 um 04:42 schrieb Timo Sirainen:
On 11.2.2012, at 12.59, Thomas Leuxner wrote:
Some more coffee later revealed doveadm/dsync being picky on the order of parameters. This works:
$ doveadm -o plugin/quota= backup -u tlx@leuxner.net mdbox:/home/tlx/mdbox
Now you have disabled quota entirely from dsync. I guess it doesn't matter in this case though, since the source mailboxes aren't modified. Anyway, my original command would have worked also, you just modified it..
Indeed I did as it did not like the syntax:
$ dsync -u tlx@leuxner.net backup dsync -o mail=mdbox:/home/backups/tlx/mdbox -o plugin/quota= backup: invalid option -- 'o' doveadm backup [-u <user>|-A] [-S <socket_path>] [-fR] [-m <mailbox>] <dest>
On 12.2.2012, at 8.54, Thomas Leuxner wrote:
Indeed I did as it did not like the syntax:
$ dsync -u tlx@leuxner.net backup dsync -o mail=mdbox:/home/backups/tlx/mdbox -o plugin/quota= backup: invalid option -- 'o' doveadm backup [-u <user>|-A] [-S <socket_path>] [-fR] [-m <mailbox>] <dest>
Oh. Hm. I'm not exactly sure why it's saying that, but adding some quotes fixes that: dsync -u tlx@leuxner.net backup 'dsync -o mail=mdbox:/home/backups/tlx/mdbox -o plugin/quota='
On 11.2.2012, at 9.58, Thomas Leuxner wrote:
$ doveadm backup -u tlx@leuxner.net mdbox:/tmp/tlx/mdbox dsync(tlx@leuxner.net): Panic: file dsync-worker-local.c: line 1643 (local_worker_save_msg_continue): assertion failed: (ret == -1)
Am 12.02.2012 um 04:45 schrieb Timo Sirainen:
On 11.2.2012, at 9.58, Thomas Leuxner wrote:
$ doveadm backup -u tlx@leuxner.net mdbox:/tmp/tlx/mdbox dsync(tlx@leuxner.net): Panic: file dsync-worker-local.c: line 1643 (local_worker_save_msg_continue): assertion failed: (ret == -1)
Thanks. Crash gone.
participants (2)
-
Thomas Leuxner
-
Timo Sirainen