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)" <ji...@apache.org> on 2011/06/18 19:19:47 UTC

[jira] [Created] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
--------------------------------------------------------------------------------------------------------

                 Key: DERBY-5284
                 URL: https://issues.apache.org/jira/browse/DERBY-5284
             Project: Derby
          Issue Type: Bug
          Components: Store
    Affects Versions: 10.8.1.2, 10.7.1.1, 10.6.1.0, 10.5.3.0, 10.4.2.0, 10.3.3.0, 10.2.2.0, 10.1.3.1
            Reporter: Mike Matrigali
            Assignee: Mike Matrigali


A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.

A problem in the split code and exact wrong timing of a crash can leave the database in as state 
where undo of purge operations corrupts index pages during redo and can cause recovery boot
to never succeed and thus the database never to be booted.  At hight level what happens is that
a purge happens on a page and before it commits another transactions uses the space of the
purge to do an insert and then commits, then the system crashes before the purging transactions
gets a chance to commit.  During undo the purge expects there to be space to undo the purge
but there is not, and it corrupts the page in various ways depending on the size and placement
of the inserts.  The error that actually returns to user varies from sane to insane as the problem
is actually noticed after the corruption occurs rather than during the undo.




 


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-5284:
----------------------------------

    Fix Version/s: 10.1.3.3

merged change from 10.4 branch to 10.1 branch.

s101_ibm16:9>svn commit

Sending        java\engine\org\apache\derby\impl\store\access\btree\BTreeController.java
Sending        java\engine\org\apache\derby\impl\store\access\heap\HeapPostCommit.java
Transmitting file data ..
Committed revision 1139109.

> A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5284
>                 URL: https://issues.apache.org/jira/browse/DERBY-5284
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1, 10.8.1.2
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>             Fix For: 10.1.3.3, 10.2.2.1, 10.3.3.1, 10.4.2.1, 10.5.3.2, 10.6.2.3, 10.7.1.4, 10.8.1.5, 10.9.0.0
>
>         Attachments: DERBY-5284_diff.txt
>
>
> A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.
> A problem in the split code and exact wrong timing of a crash can leave the database in as state 
> where undo of purge operations corrupts index pages during redo and can cause recovery boot
> to never succeed and thus the database never to be booted.  At hight level what happens is that
> a purge happens on a page and before it commits another transactions uses the space of the
> purge to do an insert and then commits, then the system crashes before the purging transactions
> gets a chance to commit.  During undo the purge expects there to be space to undo the purge
> but there is not, and it corrupts the page in various ways depending on the size and placement
> of the inserts.  The error that actually returns to user varies from sane to insane as the problem
> is actually noticed after the corruption occurs rather than during the undo.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-5284:
----------------------------------

    Fix Version/s: 10.8.1.5

backported fix from trunk to 10.8 branch, clean merge.

Sending        java\engine\org\apache\derby\impl\store\access\btree\BTreeController.java
Sending        java\engine\org\apache\derby\impl\store\access\heap\HeapCompressScan.java
Sending        java\engine\org\apache\derby\impl\store\access\heap\HeapPostCommit.java
Transmitting file data ...
Committed revision 1138570.

> A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5284
>                 URL: https://issues.apache.org/jira/browse/DERBY-5284
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1, 10.8.1.2
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>             Fix For: 10.8.1.5, 10.9.0.0
>
>         Attachments: DERBY-5284_diff.txt
>
>
> A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.
> A problem in the split code and exact wrong timing of a crash can leave the database in as state 
> where undo of purge operations corrupts index pages during redo and can cause recovery boot
> to never succeed and thus the database never to be booted.  At hight level what happens is that
> a purge happens on a page and before it commits another transactions uses the space of the
> purge to do an insert and then commits, then the system crashes before the purging transactions
> gets a chance to commit.  During undo the purge expects there to be space to undo the purge
> but there is not, and it corrupts the page in various ways depending on the size and placement
> of the inserts.  The error that actually returns to user varies from sane to insane as the problem
> is actually noticed after the corruption occurs rather than during the undo.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-5284:
----------------------------------

    Fix Version/s: 10.9.0.0

fixed in trunk.

Sending        java\engine\org\apache\derby\impl\store\access\btree\BTreeController.java
Sending        java\engine\org\apache\derby\impl\store\access\heap\HeapCompressScan.java
Sending        java\engine\org\apache\derby\impl\store\access\heap\HeapPostCommit.java
Transmitting file data ...
Committed revision 1138275.

> A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5284
>                 URL: https://issues.apache.org/jira/browse/DERBY-5284
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1, 10.8.1.2
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>             Fix For: 10.9.0.0
>
>         Attachments: DERBY-5284_diff.txt
>
>
> A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.
> A problem in the split code and exact wrong timing of a crash can leave the database in as state 
> where undo of purge operations corrupts index pages during redo and can cause recovery boot
> to never succeed and thus the database never to be booted.  At hight level what happens is that
> a purge happens on a page and before it commits another transactions uses the space of the
> purge to do an insert and then commits, then the system crashes before the purging transactions
> gets a chance to commit.  During undo the purge expects there to be space to undo the purge
> but there is not, and it corrupts the page in various ways depending on the size and placement
> of the inserts.  The error that actually returns to user varies from sane to insane as the problem
> is actually noticed after the corruption occurs rather than during the undo.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-5284:
----------------------------------

    Fix Version/s: 10.7.1.4

back ported to 10.7 branch.  clean merge.

Sending        java\engine\org\apache\derby\impl\store\access\btree\BTreeController.java
Sending        java\engine\org\apache\derby\impl\store\access\heap\HeapCompressScan.java
Sending        java\engine\org\apache\derby\impl\store\access\heap\HeapPostCommit.java
Transmitting file data ...
Committed revision 1138701.

> A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5284
>                 URL: https://issues.apache.org/jira/browse/DERBY-5284
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1, 10.8.1.2
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>             Fix For: 10.7.1.4, 10.8.1.5, 10.9.0.0
>
>         Attachments: DERBY-5284_diff.txt
>
>
> A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.
> A problem in the split code and exact wrong timing of a crash can leave the database in as state 
> where undo of purge operations corrupts index pages during redo and can cause recovery boot
> to never succeed and thus the database never to be booted.  At hight level what happens is that
> a purge happens on a page and before it commits another transactions uses the space of the
> purge to do an insert and then commits, then the system crashes before the purging transactions
> gets a chance to commit.  During undo the purge expects there to be space to undo the purge
> but there is not, and it corrupts the page in various ways depending on the size and placement
> of the inserts.  The error that actually returns to user varies from sane to insane as the problem
> is actually noticed after the corruption occurs rather than during the undo.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-5284:
----------------------------------

    Fix Version/s: 10.3.3.1
                   10.2.2.1

backported fix from 10.4 branch to the 10.3 and 10.2 branches.  By doing the merge from 10.4 where I had done a conflict resolution I got clean merges into both 10.3 and 10.2.

> A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5284
>                 URL: https://issues.apache.org/jira/browse/DERBY-5284
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1, 10.8.1.2
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>             Fix For: 10.2.2.1, 10.3.3.1, 10.4.2.1, 10.5.3.2, 10.6.2.3, 10.7.1.4, 10.8.1.5, 10.9.0.0
>
>         Attachments: DERBY-5284_diff.txt
>
>
> A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.
> A problem in the split code and exact wrong timing of a crash can leave the database in as state 
> where undo of purge operations corrupts index pages during redo and can cause recovery boot
> to never succeed and thus the database never to be booted.  At hight level what happens is that
> a purge happens on a page and before it commits another transactions uses the space of the
> purge to do an insert and then commits, then the system crashes before the purging transactions
> gets a chance to commit.  During undo the purge expects there to be space to undo the purge
> but there is not, and it corrupts the page in various ways depending on the size and placement
> of the inserts.  The error that actually returns to user varies from sane to insane as the problem
> is actually noticed after the corruption occurs rather than during the undo.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali resolved DERBY-5284.
-----------------------------------

    Resolution: Fixed

Fixed and backported to all branches from 10.1 to 10.8.

> A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5284
>                 URL: https://issues.apache.org/jira/browse/DERBY-5284
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1, 10.8.1.2
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>             Fix For: 10.1.3.3, 10.2.2.1, 10.3.3.1, 10.4.2.1, 10.5.3.2, 10.6.2.3, 10.7.1.4, 10.8.1.5, 10.9.0.0
>
>         Attachments: DERBY-5284_diff.txt
>
>
> A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.
> A problem in the split code and exact wrong timing of a crash can leave the database in as state 
> where undo of purge operations corrupts index pages during redo and can cause recovery boot
> to never succeed and thus the database never to be booted.  At hight level what happens is that
> a purge happens on a page and before it commits another transactions uses the space of the
> purge to do an insert and then commits, then the system crashes before the purging transactions
> gets a chance to commit.  During undo the purge expects there to be space to undo the purge
> but there is not, and it corrupts the page in various ways depending on the size and placement
> of the inserts.  The error that actually returns to user varies from sane to insane as the problem
> is actually noticed after the corruption occurs rather than during the undo.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-5284:
----------------------------------

    Fix Version/s: 10.6.2.3
                   10.5.3.2

backported fix to 10.6 and 10.5 branch.  Both were clean merges.

> A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5284
>                 URL: https://issues.apache.org/jira/browse/DERBY-5284
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1, 10.8.1.2
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>             Fix For: 10.5.3.2, 10.6.2.3, 10.7.1.4, 10.8.1.5, 10.9.0.0
>
>         Attachments: DERBY-5284_diff.txt
>
>
> A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.
> A problem in the split code and exact wrong timing of a crash can leave the database in as state 
> where undo of purge operations corrupts index pages during redo and can cause recovery boot
> to never succeed and thus the database never to be booted.  At hight level what happens is that
> a purge happens on a page and before it commits another transactions uses the space of the
> purge to do an insert and then commits, then the system crashes before the purging transactions
> gets a chance to commit.  During undo the purge expects there to be space to undo the purge
> but there is not, and it corrupts the page in various ways depending on the size and placement
> of the inserts.  The error that actually returns to user varies from sane to insane as the problem
> is actually noticed after the corruption occurs rather than during the undo.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-5284:
----------------------------------

    Issue & fix info: [High Value Fix, Patch Available]  (was: [High Value Fix])

> A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5284
>                 URL: https://issues.apache.org/jira/browse/DERBY-5284
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1, 10.8.1.2
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>         Attachments: DERBY-5284_diff.txt
>
>
> A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.
> A problem in the split code and exact wrong timing of a crash can leave the database in as state 
> where undo of purge operations corrupts index pages during redo and can cause recovery boot
> to never succeed and thus the database never to be booted.  At hight level what happens is that
> a purge happens on a page and before it commits another transactions uses the space of the
> purge to do an insert and then commits, then the system crashes before the purging transactions
> gets a chance to commit.  During undo the purge expects there to be space to undo the purge
> but there is not, and it corrupts the page in various ways depending on the size and placement
> of the inserts.  The error that actually returns to user varies from sane to insane as the problem
> is actually noticed after the corruption occurs rather than during the undo.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051565#comment-13051565 ] 

Mike Matrigali edited comment on DERBY-5284 at 6/19/11 6:20 PM:
----------------------------------------------------------------

patch for this issue.  Full set of tests on this patch against trunk passed.

      was (Author: mikem):
    preliminary patch for this issue.  I have not run full tests yet on this patch, but have run full successful tests against a very similar set of changes.  Will run full set of tests on this patch before committing.
  
> A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5284
>                 URL: https://issues.apache.org/jira/browse/DERBY-5284
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1, 10.8.1.2
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>         Attachments: DERBY-5284_diff.txt
>
>
> A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.
> A problem in the split code and exact wrong timing of a crash can leave the database in as state 
> where undo of purge operations corrupts index pages during redo and can cause recovery boot
> to never succeed and thus the database never to be booted.  At hight level what happens is that
> a purge happens on a page and before it commits another transactions uses the space of the
> purge to do an insert and then commits, then the system crashes before the purging transactions
> gets a chance to commit.  During undo the purge expects there to be space to undo the purge
> but there is not, and it corrupts the page in various ways depending on the size and placement
> of the inserts.  The error that actually returns to user varies from sane to insane as the problem
> is actually noticed after the corruption occurs rather than during the undo.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-5284:
----------------------------------

    Attachment: DERBY-5284_diff.txt

preliminary patch for this issue.  I have not run full tests yet on this patch, but have run full successful tests against a very similar set of changes.  Will run full set of tests on this patch before committing.

> A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5284
>                 URL: https://issues.apache.org/jira/browse/DERBY-5284
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1, 10.8.1.2
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>         Attachments: DERBY-5284_diff.txt
>
>
> A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.
> A problem in the split code and exact wrong timing of a crash can leave the database in as state 
> where undo of purge operations corrupts index pages during redo and can cause recovery boot
> to never succeed and thus the database never to be booted.  At hight level what happens is that
> a purge happens on a page and before it commits another transactions uses the space of the
> purge to do an insert and then commits, then the system crashes before the purging transactions
> gets a chance to commit.  During undo the purge expects there to be space to undo the purge
> but there is not, and it corrupts the page in various ways depending on the size and placement
> of the inserts.  The error that actually returns to user varies from sane to insane as the problem
> is actually noticed after the corruption occurs rather than during the undo.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-5284:
----------------------------------

    Fix Version/s: 10.4.2.1

backported fix from trunk to 10.4, minor conflict resolution required in merge.

s104_jdk16:22>svn commit

Sending        java\engine\org\apache\derby\impl\store\access\btree\BTreeController.java
Sending        java\engine\org\apache\derby\impl\store\access\heap\HeapCompressScan.java
Sending        java\engine\org\apache\derby\impl\store\access\heap\HeapPostCommit.java
Transmitting file data ...
Committed revision 1139085.

> A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5284
>                 URL: https://issues.apache.org/jira/browse/DERBY-5284
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1, 10.8.1.2
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>             Fix For: 10.4.2.1, 10.5.3.2, 10.6.2.3, 10.7.1.4, 10.8.1.5, 10.9.0.0
>
>         Attachments: DERBY-5284_diff.txt
>
>
> A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.
> A problem in the split code and exact wrong timing of a crash can leave the database in as state 
> where undo of purge operations corrupts index pages during redo and can cause recovery boot
> to never succeed and thus the database never to be booted.  At hight level what happens is that
> a purge happens on a page and before it commits another transactions uses the space of the
> purge to do an insert and then commits, then the system crashes before the purging transactions
> gets a chance to commit.  During undo the purge expects there to be space to undo the purge
> but there is not, and it corrupts the page in various ways depending on the size and placement
> of the inserts.  The error that actually returns to user varies from sane to insane as the problem
> is actually noticed after the corruption occurs rather than during the undo.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5284) A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051562#comment-13051562 ] 

Mike Matrigali commented on DERBY-5284:
---------------------------------------

I found this problem by code inspection and have not reproduced it myself.  This problem is another
code path of the same problem fixed by DERBY-5258.  I believe that either DERBY-5258 or this
issue are causing the problems that have been reported as DERBY-5281 and DERBY-5248.  See
those 2 issues for detailed description of order of log records and crash timing necessary to 
reproduce this problem.

At high abstract level the current code does:

get latch
purge row
release latch
close table
commit

If another transaction gets the latch and inserts rows between the release latch and the commit and the system crashes before 
the commit then this problem can happen.  The fix is to not release the latch, and let commit release it.

> A derby crash at exactly right time during a btree split can cause a corrupt db which can not be booted.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5284
>                 URL: https://issues.apache.org/jira/browse/DERBY-5284
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1, 10.8.1.2
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>
> A derby crash at exactly wrong time during a btree split can cause a corrupt db which can not be booted.
> A problem in the split code and exact wrong timing of a crash can leave the database in as state 
> where undo of purge operations corrupts index pages during redo and can cause recovery boot
> to never succeed and thus the database never to be booted.  At hight level what happens is that
> a purge happens on a page and before it commits another transactions uses the space of the
> purge to do an insert and then commits, then the system crashes before the purging transactions
> gets a chance to commit.  During undo the purge expects there to be space to undo the purge
> but there is not, and it corrupts the page in various ways depending on the size and placement
> of the inserts.  The error that actually returns to user varies from sane to insane as the problem
> is actually noticed after the corruption occurs rather than during the undo.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira