[Kde-pim] "Detected inconsistency in local cache"

Christian Mollekopf chrigi_1 at fastmail.fm
Wed Sep 24 14:13:20 BST 2014


On Wednesday 24 September 2014 14.03:18 Daniel Vratil wrote:
> > * case A: (localCount+maxAvailableMessages == remoteCount) => we can fetch
> > new messages: We know only new messages arrived, so we fetch only the new
> > ones and sync the flags for the rest.
> > 
> > * case B: (localCount+maxAvailableMessages < remoteCount) => inconsistency
> > detected: because locally deleted items are always first replayed to the
> > server, this should never happen, but is what you're running into. This
> > *does* happen if we failed to replay a removed item to the server.
> 
> I think I can reproduce this case rather easily:
> 
> I open a folder, mark some emails as read and delete some emails. Some time
> during that the Sync is started and once it finishes, the deleted emails
> appear again - this is because the the Sync is enqueued and start first (and
> the Delete/Move task is queued after Sync has started, so even with the
> ChangeReplay queue having higher priority, the task is executed after). Due
> to the async nature of Akonadi, the Item is actually removed/moved to
> another collection in Akonadi *before* the IMAP resource actually starts
> the retrieveItemsTask - which leads to the situation that you described
> above. Next time I open the folder again, the folder is fully synced.
> 
> I can reproduce it especially on larger folders, where things take more
> time, so it's easier to hit the right timing.

You're right, that actually explains two problems:
* case B: getting triggered frequently during sync
* deleted messages reappearing in akonadi (even if only temporarily, until the 
next sync)

What would IMO need to happen to prevent this is that we lock a collection for 
any modifications while a sync is in progress. Not sure how well that can be 
implemented currently though....

Currently I don't see a way how to mitigate this problem in the 
synchronization process, it seems rather a conceptual problem that we have in 
akonadi.

Cheers,
Christian

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list