Skip to content
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

Ignore already known UIDs when looking for new ones to satisfy mail_msg_mb_uid_idx #5440

Merged
merged 1 commit into from
Aug 16, 2021

Conversation

ChristophWurst
Copy link
Member

Fixes issues like #5108, #5019 and #4341

Basically if one sync attempt fails mid way after it had already inserted messages of one chunk (our level of atomicity for transacted and rolled back inserts) then the next sync will fail until the eternity. This patch discards duplicates when we determine new UIDs. Therefore the duplicates are avoided.

@ChristophWurst
Copy link
Member Author

/backport to stable1.10

Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. How could I test this?

@ChristophWurst
Copy link
Member Author

Code looks good. How could I test this?

Throw an arbitrary exception after

$this->db->commit();
. Then send a message to your inbox and sync again. Your error will show up, but the new message is stored in the DB. Then remove the exception and try again. On master you are in an unrecoverable state. On this branch the code will be able to continue.

@ChristophWurst
Copy link
Member Author

FYI deplyed this on my personal instance that was stuck before and it revived my inbox from the dead 🙌

Copy link
Contributor

@miaulalala miaulalala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@ramezrafla
Copy link

@ChristophWurst
Thanks so much for this change - a mailbox that was locked also is released now and functional.
Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants