Broken Sync (was: Re: kmail sigh)

Sandro Knauß sknauss at kde.org
Tue Jan 30 09:17:53 GMT 2018


Hey,

Just a short reminder: Akonadi nowadays has a atomic move command. So we do 
not need to find solutions for this issue. It is only only one example, why 
syncing is hard... The tricky part is to find such things, that should be 
handed as atomic operation...

> What happens instead if: Akonadi appears to stuff *all* the mails in the
> folder into the database and then moves them to the destination folder. Mail
> by mail. Honestly: It cannot get anymore more inefficient, can it?
> > The problem begins what happens when one of this things do
> > not end successfully:
> > Upload failed - move the mail back?
> > What if the upload was successful but the deletion failed?
> 
> But its failing even with a local maildir? How could it.

This was exactly also our first guess, what can go wrong when just writing a 
file to the home dir? Nothing we thought and wrote the complete code with 
nearly any error handling. That is the main reason why POP3 setups have so 
much trouble. But file systems also throws a lot of errors. You may run into 
maximum amount of inodes or no write access to the new location (why so 
ever)... or in companies the home dir is often a NFS and the NFS can hves 
hickups. And because no core dev has POP3 setup those issues never got 
priority.

> But on what to do I suggest: Either completely complete the operation or
> fail it completely. Optionally with allowing to retry it several times
> before giving up. And with operation I mean the operation from the user
> point of view i.e. move a mail. Even if it consists of several steps
> internally.
> 
> Again: I think anything else is just broken behavior.

Yes, but it is really hard to do atomic operation with a server that do not 
understand those. The filesystem knows move command - great. So for maildir 
backend it is one move and the  task is solved. But not every backend may have 
a move command, so the atomic operation needs to be split to two different 
commands create, delete. And now it can happen that the connection breaks up 
in between the commands... And now, the next time Akonadi needs to check - ah 
okay the upload was done successful so I try now the second part the deletion 
again. 

What I want to say - also if you have this "everything or nothing" paradigm 
the reality can make it really hard to reach this goal.

>[long part]
I really love to read this and I want to help others to help within KDEPim, 
doing bug-triage or getting into the code, help setup a system for DB guy etc. 
On the other side starting such things is much coordinating - So if people 
want to help "just coordinating" also please stand up... As Martin said, there 
is also a lot of work that can be done without coding skills...

If users want to reach us in person: There is a PIM meeting in Toulouse *April 
20/21/22 Weekend* and also users can be sponsored by the KDE e.V., so money 
should not be reason NOT to come. At least me would really enjoy meeting our 
users:D ( But I think also the others would enjoy it...). Also the Akadamy is 
a good place to reach us, this year in Vienna. If this is not enough, than we 
can start planning another meeting...




More information about the kdepim-users mailing list