db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kurt Huwig <k.hu...@iku-ag.de>
Subject Re: Concurrent select and insert deadlock on index
Date Sat, 18 Aug 2007 14:54:16 GMT
I created DERBY-3015 for this, as I got the same nearly every day. It works 
fine with MySQL:

https://issues.apache.org/jira/browse/DERBY-3015

Am Donnerstag, 2. August 2007 schrieb Randy Letness:
> Bogdan Calmac wrote:
> > The attached test is an attempt to simulate a typical data processing
> > application, it consists of:
> >  - an insert thread that inserts records in batch
> >  - a select thread that 'processes' the records inserted by the other
> > thread: 'select * from table where id > ?'
> >
> > The test deadlocks, the trace can be found in 'derby.log' and the java
> > stacktraces just before the deadlock in
> > 'stacktraces_during_deadlock.txt'.
> >
> > After examining them, I think that:
> >  - the select thread holds an S lock on the root of the PK index: (1,1)
> >  - the select thread waits for an S lock on one of the uncommitted
> > inserts
> >
> >  - the insert thread holds X locks on the inserted records
> >  - the insert thread tries to split the btree root of the PK index:
> > (1,1) by acquiring an X lock, so it's a deadlock
> >
> > Before jumping to conclusions, can somebody confirm if this looks like
> > an expected behaviour or is it a bug?
>
> This sounds like the same index split deadlock problem I ran into a few
> months ago:
>
> http://mail-archives.apache.org/mod_mbox/db-derby-user/200701.mbox/%3C45C0E
>3DA.4070903@sbcglobal.net%3E
>
> Unfortunately I wasn't able to find a work around. Increasing the page
> size didn't help.  I think this may be an issue with non MVCC databases.
>
> -Randy



-- 
Mit freundlichen Grüßen

Kurt Huwig (Vorstand)
Telefon 0681/96751-50, Telefax 0681/96751-66
http://www.iku-ag.de/

iKu Systemhaus AG, Am Römerkastell 4, 66121 Saarbrücken
Amtsgericht: Saarbrücken, HRB 13240
Vorstand: Kurt Huwig, Andreas Niederländer
Aufsichtsratsvorsitzender: Jan Bankstahl

GnuPG 1024D/99DD9468 64B1 0C5B 82BC E16E 8940  EB6D 4C32 F908 99DD 9468

Mime
View raw message