-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
quota -f wrongly removes quota roots from sub mailboxes #2877
Comments
If you never set quotas on sub mailboxes, but quota -f removes quota roots from sub mailboxes, then are you saying that Are you able to verify (before running -f) that the sub mailboxes definitely don't accidentally have a quota root set somehow? (Maybe the user's client is setting them?) I'm trying to reproduce this (without deliberately creating quotas on the sub mailboxes) but so far haven't been able to... |
Okay, what we do is, we set quota on the INBOX and this includes all the sub folders/mailboxes (e.g. Archive, Drafts, Junk, Sent, Trash, …), in the corresponding Running Running To be fair, For one account we could fix the problem by moving the user to another Cyrus backend with It seems there is race condition somewhere in |
That makes sense, and is pretty much exactly what I started out testing with
Aaand that's where things get weird!
Long shot, but can you think of anything the accounts this affects might have in common? (Though, I assume if you could, you would've already mentioned.) I don't suppose they're listed in
So, it sounds like it keeps happening with these accounts, even after they've been fixed once they're liable to get weird again? And accounts that don't have the problem don't seem to get it, either?
Thanks. It's sounding to me like the key here is going to be figuring what weird thing these accounts have in common, and if we can reproduce that we can probably reproduce the problem. Meanwhile, I'll have another look through the quota tool code and see if any unhandled edge cases stick out from that direction... |
Not sure if it's important, but what's your value for |
So, this output comes from It's very interesting to observe that |
I think I've found it! If
i.e. This is the exact class of problem that improved_mboxlist_sort is meant to resolve, but it's also a fairly complicated procedure to change it on a live system (so don't just reflexively do that!) I think I have a fix on the way... |
I think this commit fixes it, by making an optimisation that can only work with The optimisation was originally added as 054f7f2 (2.5.0), and its commit message reads:
So, as a side effect I guess my fix re-opens "the window in which folders can be created and not counted correctly", but I'm not sure if anything can be done about that. It seems to work okay for me in testing. Do you have somewhere to gently test it yourself, and see if it fixes the issue (and doesn't break anything else)? |
In hindsight, I guess this worked for that one user because the backend they were moved to didn't have some other very similar userid with a hyphen in a bad place. But when you mass-moved several complete backends, the userid combinations that trigger the bug all got moved together, so it kept happening. I keep saying "hyphen", but I really mean "any character that is valid in a mailbox name and sorts earlier than |
Okay, I checked and |
I tried the patch (elliefm/cyrus-imapd@06778af) on a test system with production data and it fixed the broken quota roots. This patch seems to fix our problems. |
Great, thanks heaps for testing that out! I'll get it merged properly for inclusion in future releases. |
When improved_mboxlist_sort is not enabled, we cannot rely on mailbox iteration order to prove we're finished with any particular quotaroot. Fixes cyrusimap#2877
When improved_mboxlist_sort is not enabled, we cannot rely on mailbox iteration order to prove we're finished with any particular quotaroot. Fixes #2877
Ubuntu 18.04
Cyrus-IMAP 3.0.11 build from source (replication enabled)
Cyrus SASL 2.1.27~101-g0780600+dfsg-3ubuntu2
Problems also seen on FreeBSD 10.3/11.3 with Cyrus 3.0.11 and 2.5
On some mailboxes there is a problem with quota handling, but most of the mailboxes are handled correctly. The problem occurs when running
quota -f
to fix quotas, but instead it removes some quota roots from sub mailboxes. We set quotas only on top level mailboxes never on sub mailboxes.This is how the quota should look like:
But after running
quota -f
, quota roots in sub mailboxes are being removed and in the correspondingcyrus.header
files:Correct Quota for the user can only be restored by removing quota completely for that user from the
quota_db
and then set the quota again. But anotherquota -f
will remove the quota roots from sub mailboxes again.The text was updated successfully, but these errors were encountered: