Expected semantics of LocalStatus files

John Goerzen jgoerzen at complete.org
Wed Sep 8 22:47:18 BST 2010


On 09/07/2010 11:04 PM, Rob Browning wrote:
> I've been evaluating offlineimap lately, and I noticed that it was very
> slow when dealing with large maildirs.  After some investigation, I
> tracked the problem down to the code in LocalStatus.py that writes the
> status file.

Hi Rob,

You may be interested to look at the mailing list archives.  Someone 
else has already written a Sqlite3 backend for LocalStatus, and others 
have proposed not saving as often.  I didn't apply the Sqlite3 backend, 
IIRC, because it didn't yet have a migration path for current users.

> That made me wonder about the semantics of the LocalStatus files.
> i.e. what happens if they're missing?  Is that a catastrophic failure,

They're critical.  They record the last state of the server.  If a 
LocalStatus file disappears, then there is no way to know what was on 
the server at last sync.  Without that information, there's no way to 
know that a specific message was added, deleted, etc.

> or can they be re-generated?  If the latter, then I thought it might be

The usual method if a LocalStatus is lost would be to throw away the 
local folder and re-copy everything from the server.

> possible to improve the performance by just deleting the file at the
> beginning of a sequence of copies, and then rewrite it just once
> (atomically) after all the updates for that folder have been finished.
> Any intervening crash would just leave the file missing.

That would result in duplicate mail.

-- John




More information about the OfflineIMAP-project mailing list