You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Mike Matrigali (JIRA)" <de...@db.apache.org> on 2006/04/07 01:41:28 UTC

[jira] Created: (DERBY-1189) latch self deadlock when running inplace compress

latch self deadlock when running inplace compress
-------------------------------------------------

         Key: DERBY-1189
         URL: http://issues.apache.org/jira/browse/DERBY-1189
     Project: Derby
        Type: Bug

  Components: Store  
    Versions: 10.1.1.0, 10.1.1.1, 10.1.1.2, 10.1.2.0, 10.1.2.1, 10.1.2.2, 10.1.2.3, 10.2.0.0    
    Reporter: Mike Matrigali
 Assigned to: Mike Matrigali 
     Fix For: 10.2.0.0


The following script , before the fix, causes online compress to attempt to latch the same page twice in a nested user transaction causing a self deadlock of the form:
ij> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
ERROR 40001: A lock could not be obtained due to a deadlock, cycle of locks and
waiters is:
Lock : LATCH, T1, Page(35,Container(0, 1728))
  Waiting XID : {385920, BaseContainerHandle:(Container(0, 1728))} , APP, CALL S
YSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1)
  Granted XID : {385920, BaseContainerHandle:(Container(0, 1728))}
. The selected victim is XID : 385920.

script that reproduces it:
drop table t1;
create table t1 (i integer primary key, j integer, c char(200));
insert into t1 values (1, 1, 'a');
insert into t1 (select t1.i + 2,    t1.j + 2,    t1.c from t1);
insert into t1 (select t1.i + 4,    t1.j + 4,    t1.c from t1);
insert into t1 (select t1.i + 8,    t1.j + 8,    t1.c from t1);
insert into t1 (select t1.i + 16,   t1.j + 16,   t1.c from t1);
insert into t1 (select t1.i + 32,   t1.j + 32,   t1.c from t1);
insert into t1 (select t1.i + 64,   t1.j + 64,   t1.c from t1);
insert into t1 (select t1.i + 128,  t1.j + 128,  t1.c from t1);
insert into t1 (select t1.i + 256,  t1.j + 256,  t1.c from t1);
insert into t1 (select t1.i + 512,  t1.j + 512,  t1.c from t1);
insert into t1 (select t1.i + 1024, t1.j + 1024, t1.c from t1);

delete from t1 where j=1;

CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);

delete from t1 where j=2;

CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);

delete from t1 where i > 1024;

CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);

delete from t1 where i < 512;

CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (DERBY-1189) latch self deadlock when running inplace compress

Posted by "Mike Matrigali (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1189?page=all ]
     
Mike Matrigali resolved DERBY-1189:
-----------------------------------

    Resolution: Fixed

Checked in the fix:
Author: mikem
Date: Thu Apr  6 23:11:13 2006
New Revision: 392194

URL: http://svn.apache.org/viewcvs?rev=392194&view=rev
Log:
DERBY-1189

inplace compress could self deadlock on a latch/latch conflict.  Changed
the insert page find code for defragment to never return a page which is
higher than the source page of the row.  Previously the upper level code
made this decision, but that was too late.  As part of the change also 
optimized the "unfilled" search to be biased towards those pages near
the front of the container.  Checkin includes simple sql script which 
reproduced the deadlock prior to the fix.



Added:

> latch self deadlock when running inplace compress
> -------------------------------------------------
>
>          Key: DERBY-1189
>          URL: http://issues.apache.org/jira/browse/DERBY-1189
>      Project: Derby
>         Type: Bug

>   Components: Store
>     Versions: 10.1.1.0, 10.1.1.1, 10.1.1.2, 10.1.2.0, 10.1.2.1, 10.1.2.2, 10.1.2.3, 10.2.0.0
>     Reporter: Mike Matrigali
>     Assignee: Mike Matrigali
>      Fix For: 10.2.0.0

>
> The following script , before the fix, causes online compress to attempt to latch the same page twice in a nested user transaction causing a self deadlock of the form:
> ij> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> ERROR 40001: A lock could not be obtained due to a deadlock, cycle of locks and
> waiters is:
> Lock : LATCH, T1, Page(35,Container(0, 1728))
>   Waiting XID : {385920, BaseContainerHandle:(Container(0, 1728))} , APP, CALL S
> YSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1)
>   Granted XID : {385920, BaseContainerHandle:(Container(0, 1728))}
> . The selected victim is XID : 385920.
> script that reproduces it:
> drop table t1;
> create table t1 (i integer primary key, j integer, c char(200));
> insert into t1 values (1, 1, 'a');
> insert into t1 (select t1.i + 2,    t1.j + 2,    t1.c from t1);
> insert into t1 (select t1.i + 4,    t1.j + 4,    t1.c from t1);
> insert into t1 (select t1.i + 8,    t1.j + 8,    t1.c from t1);
> insert into t1 (select t1.i + 16,   t1.j + 16,   t1.c from t1);
> insert into t1 (select t1.i + 32,   t1.j + 32,   t1.c from t1);
> insert into t1 (select t1.i + 64,   t1.j + 64,   t1.c from t1);
> insert into t1 (select t1.i + 128,  t1.j + 128,  t1.c from t1);
> insert into t1 (select t1.i + 256,  t1.j + 256,  t1.c from t1);
> insert into t1 (select t1.i + 512,  t1.j + 512,  t1.c from t1);
> insert into t1 (select t1.i + 1024, t1.j + 1024, t1.c from t1);
> delete from t1 where j=1;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> delete from t1 where j=2;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> delete from t1 where i > 1024;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> delete from t1 where i < 512;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-1189) latch self deadlock when running inplace compress

Posted by "Mike Matrigali (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1189?page=all ]

Mike Matrigali updated DERBY-1189:
----------------------------------

    Fix Version: 10.1.3.0

backported trunk fix into 10.1 branch for 10.1.3 release:
m101_142:91>svn commit
Sending        java\engine\org\apache\derby\impl\store\raw\data\FileContainer.java
Adding         java\testing\org\apache\derbyTesting\functionTests\master\st_derby1189.out
Sending        java\testing\org\apache\derbyTesting\functionTests\suites\storetests.runall
Sending        java\testing\org\apache\derbyTesting\functionTests\tests\storetests\copyfiles.ant
Adding         java\testing\org\apache\derbyTesting\functionTests\tests\storetests\st_derby1189.sql
Adding         java\testing\org\apache\derbyTesting\functionTests\tests\storetests\st_derby1189_app.properties
Transmitting file data ...
Committed revision 393855

> latch self deadlock when running inplace compress
> -------------------------------------------------
>
>          Key: DERBY-1189
>          URL: http://issues.apache.org/jira/browse/DERBY-1189
>      Project: Derby
>         Type: Bug

>   Components: Store
>     Versions: 10.1.1.0, 10.2.0.0, 10.1.2.0, 10.1.1.1, 10.1.1.2, 10.1.2.1, 10.1.2.2, 10.1.2.3
>     Reporter: Mike Matrigali
>     Assignee: Mike Matrigali
>      Fix For: 10.2.0.0, 10.1.3.0

>
> The following script , before the fix, causes online compress to attempt to latch the same page twice in a nested user transaction causing a self deadlock of the form:
> ij> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> ERROR 40001: A lock could not be obtained due to a deadlock, cycle of locks and
> waiters is:
> Lock : LATCH, T1, Page(35,Container(0, 1728))
>   Waiting XID : {385920, BaseContainerHandle:(Container(0, 1728))} , APP, CALL S
> YSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1)
>   Granted XID : {385920, BaseContainerHandle:(Container(0, 1728))}
> . The selected victim is XID : 385920.
> script that reproduces it:
> drop table t1;
> create table t1 (i integer primary key, j integer, c char(200));
> insert into t1 values (1, 1, 'a');
> insert into t1 (select t1.i + 2,    t1.j + 2,    t1.c from t1);
> insert into t1 (select t1.i + 4,    t1.j + 4,    t1.c from t1);
> insert into t1 (select t1.i + 8,    t1.j + 8,    t1.c from t1);
> insert into t1 (select t1.i + 16,   t1.j + 16,   t1.c from t1);
> insert into t1 (select t1.i + 32,   t1.j + 32,   t1.c from t1);
> insert into t1 (select t1.i + 64,   t1.j + 64,   t1.c from t1);
> insert into t1 (select t1.i + 128,  t1.j + 128,  t1.c from t1);
> insert into t1 (select t1.i + 256,  t1.j + 256,  t1.c from t1);
> insert into t1 (select t1.i + 512,  t1.j + 512,  t1.c from t1);
> insert into t1 (select t1.i + 1024, t1.j + 1024, t1.c from t1);
> delete from t1 where j=1;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> delete from t1 where j=2;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> delete from t1 where i > 1024;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> delete from t1 where i < 512;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-1189) latch self deadlock when running inplace compress

Posted by "Mike Matrigali (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1189?page=all ]

Mike Matrigali updated DERBY-1189:
----------------------------------


It is likely this is the same problem as DERBY-1118, but I have reported as a separate issue as I did not reproduce the 
Cache errors reported in that issue.  Once this fix is made to the trunk  I hope that the DERBY-1118 reporter can rerun 
their tests to see if it is also fixed.

> latch self deadlock when running inplace compress
> -------------------------------------------------
>
>          Key: DERBY-1189
>          URL: http://issues.apache.org/jira/browse/DERBY-1189
>      Project: Derby
>         Type: Bug

>   Components: Store
>     Versions: 10.1.1.0, 10.1.1.1, 10.1.1.2, 10.1.2.0, 10.1.2.1, 10.1.2.2, 10.1.2.3, 10.2.0.0
>     Reporter: Mike Matrigali
>     Assignee: Mike Matrigali
>      Fix For: 10.2.0.0

>
> The following script , before the fix, causes online compress to attempt to latch the same page twice in a nested user transaction causing a self deadlock of the form:
> ij> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> ERROR 40001: A lock could not be obtained due to a deadlock, cycle of locks and
> waiters is:
> Lock : LATCH, T1, Page(35,Container(0, 1728))
>   Waiting XID : {385920, BaseContainerHandle:(Container(0, 1728))} , APP, CALL S
> YSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1)
>   Granted XID : {385920, BaseContainerHandle:(Container(0, 1728))}
> . The selected victim is XID : 385920.
> script that reproduces it:
> drop table t1;
> create table t1 (i integer primary key, j integer, c char(200));
> insert into t1 values (1, 1, 'a');
> insert into t1 (select t1.i + 2,    t1.j + 2,    t1.c from t1);
> insert into t1 (select t1.i + 4,    t1.j + 4,    t1.c from t1);
> insert into t1 (select t1.i + 8,    t1.j + 8,    t1.c from t1);
> insert into t1 (select t1.i + 16,   t1.j + 16,   t1.c from t1);
> insert into t1 (select t1.i + 32,   t1.j + 32,   t1.c from t1);
> insert into t1 (select t1.i + 64,   t1.j + 64,   t1.c from t1);
> insert into t1 (select t1.i + 128,  t1.j + 128,  t1.c from t1);
> insert into t1 (select t1.i + 256,  t1.j + 256,  t1.c from t1);
> insert into t1 (select t1.i + 512,  t1.j + 512,  t1.c from t1);
> insert into t1 (select t1.i + 1024, t1.j + 1024, t1.c from t1);
> delete from t1 where j=1;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> delete from t1 where j=2;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> delete from t1 where i > 1024;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> delete from t1 where i < 512;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DERBY-1189) latch self deadlock when running inplace compress

Posted by "Mike Matrigali (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1189?page=all ]
     
Mike Matrigali closed DERBY-1189:
---------------------------------


> latch self deadlock when running inplace compress
> -------------------------------------------------
>
>          Key: DERBY-1189
>          URL: http://issues.apache.org/jira/browse/DERBY-1189
>      Project: Derby
>         Type: Bug

>   Components: Store
>     Versions: 10.1.1.0, 10.1.1.1, 10.1.1.2, 10.1.2.0, 10.1.2.1, 10.1.2.2, 10.1.2.3, 10.2.0.0
>     Reporter: Mike Matrigali
>     Assignee: Mike Matrigali
>      Fix For: 10.2.0.0, 10.1.3.0

>
> The following script , before the fix, causes online compress to attempt to latch the same page twice in a nested user transaction causing a self deadlock of the form:
> ij> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> ERROR 40001: A lock could not be obtained due to a deadlock, cycle of locks and
> waiters is:
> Lock : LATCH, T1, Page(35,Container(0, 1728))
>   Waiting XID : {385920, BaseContainerHandle:(Container(0, 1728))} , APP, CALL S
> YSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1)
>   Granted XID : {385920, BaseContainerHandle:(Container(0, 1728))}
> . The selected victim is XID : 385920.
> script that reproduces it:
> drop table t1;
> create table t1 (i integer primary key, j integer, c char(200));
> insert into t1 values (1, 1, 'a');
> insert into t1 (select t1.i + 2,    t1.j + 2,    t1.c from t1);
> insert into t1 (select t1.i + 4,    t1.j + 4,    t1.c from t1);
> insert into t1 (select t1.i + 8,    t1.j + 8,    t1.c from t1);
> insert into t1 (select t1.i + 16,   t1.j + 16,   t1.c from t1);
> insert into t1 (select t1.i + 32,   t1.j + 32,   t1.c from t1);
> insert into t1 (select t1.i + 64,   t1.j + 64,   t1.c from t1);
> insert into t1 (select t1.i + 128,  t1.j + 128,  t1.c from t1);
> insert into t1 (select t1.i + 256,  t1.j + 256,  t1.c from t1);
> insert into t1 (select t1.i + 512,  t1.j + 512,  t1.c from t1);
> insert into t1 (select t1.i + 1024, t1.j + 1024, t1.c from t1);
> delete from t1 where j=1;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> delete from t1 where j=2;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> delete from t1 where i > 1024;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);
> delete from t1 where i < 512;
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'T1', 1, 1, 1);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira