loggerhead uses bdb

Bug #87355 reported by David Allouche
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Michael Hudson-Doyle
loggerhead
Fix Released
Medium
Robey Pointer

Bug Description

loggerhead, that is currently tested on codebrowse.launchpad.net, uses bdb to maintain its indexes.

bdb is notoriously fragile, and has the annoying habit of corrupting its database and stopping to work. The Subversion developers started using bdb but moved away from it because of this problem.

Today (2007-02-23) we had to clear the (painfully generated) loggerhead indexes because it was no longer working correctly and was spewing errors like the following:
Exception bsddb.db.DBRunRecoveryError: (-30977, 'DB_RUNRECOVERY: Fatal error, run database recovery -- PANIC: fatal region error detected; run recovery') in ignored

Before we can use loggerhead as a production service, we must replace bdb by something more robust than three pieces of cardboard assembled with spit and duct tape.

Tags: lp-code

Related branches

Revision history for this message
David Allouche (ddaa) wrote :

High priority. Code browsing is shiny and makes users happy.

description: updated
Changed in launchpad-bazaar:
importance: Undecided → High
status: Unconfirmed → Confirmed
description: updated
Revision history for this message
Robey Pointer (robey) wrote :

i agree that bdb sucks but since loggerhead uses shelve, it ought to be using "anydbm", which translates to gdbm (i would assume). is that not the case? or does gdbm suck just as bad?

i've had good experiences with both sleepycat and sqlite, so those are potential alternatives.

Changed in loggerhead:
assignee: nobody → robey
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
David Allouche (ddaa) wrote :

I do not know how gdbm compares to bdb. In the last launchpad-bazaar meeting somebody suggested that the corruption we observe might be caused by faulty locking in the client code. If this is true (no opinion, really), then this probably is probably (just speculating) shared by all bdb clones.

In the same meeting, good things were said about sqlite. Actually, I ONLY ever heard good things about sqlite. The only downside I can see is that it "Supports databases up to 2 tebibytes", which could conceivably be a limitation in the forseeable future for codebrowse.launchpad.net since loggerhead apparently caches full-text diffs. But when we get there, we'll probably need to get creative anyway, and use a more heavy-weight DBM such as Postgres.

In short, I really have no clue. But sqlite has good karma among the launchpad developers.

Revision history for this message
James Henstridge (jamesh) wrote :

Note that anydbm picks "dbhash" in preference to "gdbm", which is Berkeley DB. I have no idea whether gdbm would be better or worse for this.

Revision history for this message
Robey Pointer (robey) wrote : Re: [Bug 87355] Re: loggerhead uses bdb

Loggerhead just uses shelve to store processed revision entries and
search keys, so it's always in the form (key => pickled blob). It
would probably make baby Tux cry to use a relational db like sqlite
to store those blobs, but if it would be more stable, it's worth trying.

I'm also holding out a tiny hope that the current bazaar
optimizations will end up making the revision cache a lot less
important, maybe even to the point where I could remove it
completely. The search index could be made relational anyway. Just
kinda thinking out loud...

robey

Revision history for this message
Nicholas Allen (nick-allen) wrote :

I ran into this problem too. Is this likely to change anytime soon?

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Depends on your value of soon :)

Within the next few months, at least.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Getting somewhere with this now.

Changed in launchpad-bazaar:
status: Confirmed → In Progress
assignee: nobody → mwhudson
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

loggerhead RF revision 138.

Changed in launchpad-bazaar:
status: In Progress → Fix Committed
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

We rolled out the no-more-bdb branch to codebrowse.launchpad.net, yay.

Changed in launchpad-bazaar:
status: Fix Committed → Fix Released
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Released in 1.2.

Changed in loggerhead:
status: Confirmed → Fix Committed
Changed in loggerhead:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.