[Dev] new logic for running recovery

Andi Vajda vajda at osafoundation.org
Tue Feb 15 17:08:25 PST 2005


When a Berkeley DB database is opened with DB_RECOVER, recovery against the 
database logs is run to recover transactions or data that were possibly lost 
when the database was not properly closed.
(for more details, see http://www.sleepycat.com/docs/ref/transapp/app.html)

Until now, we always opened the repository with DB_RECOVER since it is 
unharmful to run recovery when no recovery is needed and, in development mode, 
Chandler is constantly aborted instead of being properly quit.

The problem though is that running recovery takes some time, 2.5s on my 
Powerbook to be precise, whereas opening the repository without recovery only 
takes 0.03s. Given that we've got only 5s allotted from startup time, spending 
half of that on something we don't need is rather wasteful.

So, the repository open logic was changed to run recovery when it is actually 
needed and it now has ways to auto-detect that. If you want to force running 
recovery on your repository, you can use the Berkeley db_recover utility or 
start Chandler with -R (or --recover).

Startup time on my fast linux box went down by more thanb a second, and 
on my mac went down a full 2.5s. Little by little....

Andi..


More information about the Dev mailing list