Forum OpenACS Development: Re: Deadlock detected (in Postgres 7.3x)

Posted by Andrew Piskorski on
To fix it your probably going to have to either track down exactly what's causing that deadlock, or just keep re-running things until you get all your data in and the upgrade is done.

Are you by chance updating tables a,b,c in one transaction, and tables b,c,a in another transaction - same tables but different order? That's one easy way I know of to generate deadlocks in Oracle, and annoying because AFAIK there are no tools whatsoever to help you avoid it, either.

But, this is during a site upgrade, so presumably you have only one single transaction going at a time, right? Offhand, I can't think of any way that a single transaction could possibly deadlock itslef, in fact I believe that's impossible. So something seems weird there...

Oh, btw, I'm thinking in terms of Oracle 8.x here. PostgreSQL should be basically the same (both use MVCC, etc.) but I'm sure there must be differences in the details of the two RDBMSs' deadlock detection algorithms.

Posted by Jade Rubick on
That's what seems so weird to me. I can't think of any way an upgrade script with nothing else running could deadlock itself. Especially since nothing is done in parallel.

The only thing I can think of that could happen during the upgrade is database vacuuming. Has anyone heard of that causing problems?