Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-1189

latch self deadlock when running inplace compress

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6
    • 10.1.3.1, 10.2.1.6
    • Store
    • None

    Description

      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);

      Attachments

        Activity

          People

            mikem Mike Matrigali
            mikem Mike Matrigali
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: