db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Matrigali (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (DERBY-4182) SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE does not reclaim space lost from an aborted insert
Date Tue, 26 May 2009 23:31:45 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mike Matrigali resolved DERBY-4182.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 10.6.0.0

DERBY-4182

Before this fix abort of inserts that included clob or blob chains would
destroy the links of the allocated pages of the chains.  This would leave
allocated pages that could never be reclaimed either by subsequent post
commit processing or inplace compress.  Only offline compress could reclaim
the space.  This fix changes insert abort processing to automatically put
all pieces of long columns except for the head page on the free list as part
of the abort.

Note this does not fix existing tables that have had this problem happen in
the past, only stops it from happening.  One must run an offline compress to
reclaim this space to fix any instances of this bug prior to this fix.

svn 778926 fixes this bug in the trunk.  Once this change has passed nightly
tests in the community across a number of platforms I plan to backport it at
least to 10.3.

m4_ibm16:147>svn commit

Sending        java\engine\org\apache\derby\impl\store\raw\data\BasePage.java
Sending        java\testing\org\apache\derbyTesting\functionTests\tests\store\Cl
obReclamationTest.java
Transmitting file data ..
Committed revision 778926.

> SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE  does not reclaim space lost from an aborted
insert
> -------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4182
>                 URL: https://issues.apache.org/jira/browse/DERBY-4182
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.1.1, 10.6.0.0
>            Reporter: Kathey Marsden
>            Assignee: Mike Matrigali
>             Fix For: 10.6.0.0
>
>         Attachments: DERBY4182.diff, TestInPlaceCompressWithPKViolation.java
>
>
> Because of DERBY-691 an aborted insert (for example due to a constraint violation or
rollback) can cause space to not be reclaimed.  SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE  should
reclaim this space. Even if it cannot return the space to the operating system it should show
up as free pages after calling the procedure, but it currently does not.   SYSCS_UTIL.SYSCS_COMPRESS_TABLE
works properly and returns the space to the operating system.
> See the attached program TestInPlaceCompressWithPKViolation.java to reproduce this problem.
 The program attempts 10 3MB inserts. One is successful and 9 fail.   SpaceTable queries show
only 18 pages are  marked as free after inplace compress and none returned to the os.
> The statement was aborted because it would have caused a duplicate key value in a unique
or primary key constraint or un
> ique index identified by 'SQL090422155557650' defined on 'TAB'.
> The statement was aborted because it would have caused a duplicate key value in a unique
or primary key constraint or un
> ique index identified by 'SQL090422155557650' defined on 'TAB'.
> The statement was aborted because it would have caused a duplicate key value in a unique
or primary key constraint or un
> ique index identified by 'SQL090422155557650' defined on 'TAB'.
> The statement was aborted because it would have caused a duplicate key value in a unique
or primary key constraint or un
> ique index identified by 'SQL090422155557650' defined on 'TAB'.
> The statement was aborted because it would have caused a duplicate key value in a unique
or primary key constraint or un
> ique index identified by 'SQL090422155557650' defined on 'TAB'.
> The statement was aborted because it would have caused a duplicate key value in a unique
or primary key constraint or un
> ique index identified by 'SQL090422155557650' defined on 'TAB'.
> The statement was aborted because it would have caused a duplicate key value in a unique
or primary key constraint or un
> ique index identified by 'SQL090422155557650' defined on 'TAB'.
> The statement was aborted because it would have caused a duplicate key value in a unique
or primary key constraint or un
> ique index identified by 'SQL090422155557650' defined on 'TAB'.
> The statement was aborted because it would have caused a duplicate key value in a unique
or primary key constraint or un
> ique index identified by 'SQL090422155557650' defined on 'TAB'.
> *****spaceTable before SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP','TAB',1,1,1)
> CONGLOMERATENAME
>         |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |NUMUNFILLEDPAGES    |PAGESIZE
  |ESTIMSPACESAVING
> ------------------------------------------------------------------------------------------------------------------------
> ---------------------------------------------------------------------------------------------------------------
> TAB
>         |0     |931                 |0                   |2                   |32768
     |0
> *****spaceTable after SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP','TAB',1,1,1)
> CONGLOMERATENAME
>         |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |NUMUNFILLEDPAGES    |PAGESIZE
  |ESTIMSPACESAVING
> ------------------------------------------------------------------------------------------------------------------------
> ---------------------------------------------------------------------------------------------------------------
> TAB
>         |0     |913                 |18                  |1                   |32768
     |589824
> *****spaceTable after SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP','TAB',1)
> CONGLOMERATENAME
>         |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |NUMUNFILLEDPAGES    |PAGESIZE
  |ESTIMSPACESAVING
> ------------------------------------------------------------------------------------------------------------------------
> ---------------------------------------------------------------------------------------------------------------
> TAB
>         |0     |95                  |0                   |1                   |32768
     |0

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message