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 2010/12/01 02:03:11 UTC

[jira] Created: (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

update of a long row can fail with ERROR nospc: nospc.U exception.
------------------------------------------------------------------

                 Key: DERBY-4923
                 URL: https://issues.apache.org/jira/browse/DERBY-4923
             Project: Derby
          Issue Type: Bug
    Affects Versions: 10.6.2.1, 10.6.1.0, 10.5.3.0
            Reporter: Mike Matrigali
            Assignee: Mike Matrigali


An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.

The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
cause the repro), I will be attaching a test case:
The row being updated has the following characteristics:
    o located on 4k page
    o 2 colum row with 2nd column a blob column
    o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
    o before the update there is 0 free space on the overflow page.
    o the update causes the blob column to expand past 4k 

Caused by: java.sql.SQLException: nospc.U
    at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
    at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
    at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
    ... 39 more
Caused by: ERROR nospc: nospc.U
    at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
    at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
    at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
    at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
    at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
    at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
    at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
    at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
    at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
    at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
    at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
    at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
    at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
    ... 33 more

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


[jira] [Commented] (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Mike Matrigali commented on DERBY-4923:
---------------------------------------

I do believe it is always a bug if a NoSpaceOnPage leaks out to a user.  There is a normal case where we can't insert and/or update keys in indexes over a certain size, but I think that
gets wrapped in a different exception.

If the code were acting correctly then it would have reserved enough space such that the operation is not leaking the exception.  So at least in the cases that I have debugged in the
past the bug is not in the operation that is failing, it is in  a previous operation that lead to the page getting to state with not enough reserved space to do the operation.  There are 
2 things to handle.  First is that the head of a row in a base table (heap) can never move off its page, so you must reserve enough space in the head row/page so that in the worst
case you can change the row to one that just has the head of row pointing to a linked list of all the other columns on another page.  The second case is handling the "middle" of the
row on another page.  Again similarly the design is to reserve enough space for the row such that if you need to expand it there is always enough space in worst case to just make
it a pointer yet another chunk somewhere.  It gets tricky in that a row might be smaller than what is necessary in the worst case to be one of these pointers.  

The mostly likely place for this bug to happen would be in UpdateOperation and UpdateFieldOperation as these result in expanding the length of the row in place. 

CopyRowsOperation prechecks that the destination of the rows has space and maintains a latch so that it is guaranteed.  I remember a NoSpaceOnPage bug in the past in this one
where the bug was in the check not accounting for the correct change in compressed size of the page field, so in this case the bug was in the operation and not in the previous operaition.

InsertOperation is the normal path for NoSpaceOnPage exceptions, I expect that somehow the code is set to catch these as it is the normal way to tell to insert a row somewhere else
rather than where it does not fit.


                
> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>              Labels: derby_triage10_8
>         Attachments: DERBY_4923.java, derby-4923-tt-aa-NoSpaceOnPageExtendsException.diff, derby.log, derby4923repro.diff
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Mike Matrigali updated DERBY-4923:
----------------------------------

    Assignee:     (was: Mike Matrigali)

i had plans to look at this, but not top of my list.  unassiging it for now and will change if I am actively working on it.
                
> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>              Labels: derby_triage10_8
>         Attachments: derby.log, derby4923repro.diff
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Mike Matrigali updated DERBY-4923:
----------------------------------

    Urgency: Urgent
     Labels: derby_triage10_8  (was: )

reproducible serious bug setting urgency to urgent.  Once hit the row can't be updated any more.

triaged for 10.8.

> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>              Labels: derby_triage10_8
>         Attachments: derby.log, derby4923repro.diff
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

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

        

[jira] [Updated] (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Rick Hillegas updated DERBY-4923:
---------------------------------

    Attachment: derby-4923-tt-aa-NoSpaceOnPageExtendsException.diff

Comments on DERBY-4577 and DERBY-4923 suggest that NoSpaceOnPage is a transient signal passed between methods inside StoredPage. If you grep the codeline, you see that StoredPage is the only class which mentions this exception. Low level logging methods throw NoSpaceOnPage to tell their callers that there isn't enough room on the page for the operation. The callers (in StoredPage) are supposed to allocate more space and then retry the operation. It seems that NoSpaceOnPage should never leak out of StoredPage. It should never escape to methods higher on the call stack. Does that sound correct?

I am attaching derby-4923-tt-aa-NoSpaceOnPageExtendsException.diff. This patch changes NoSpaceOnPage, making it directly extend Exception so that it is no longer a StandardException. With this change you can see that it may be possible for NoSpaceOnPage to escape outside StoredPage to methods in the following classes:

UpdateOperation
CopyRowsOperation
DirectActions
UpdateFieldOperation
InsertOperation

There may be reasons why some of these callers can be confident that they won't ever see a NoSpaceOnPage exception. However, I don't understand how we can prove that assertion for any of these classes. It's clear that NoSpaceOnPage can leak up to at least one of these classes (UpdateOperation), perhaps in several ways given the number of bugs we have seen with this stack trace.

Is there some way that we can prove that NoSpaceOnPage won't escape to any of the other calling classes?

Thanks,
-Rick

                
> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>              Labels: derby_triage10_8
>         Attachments: DERBY_4923.java, derby-4923-tt-aa-NoSpaceOnPageExtendsException.diff, derby.log, derby4923repro.diff
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Rick Hillegas updated DERBY-4923:
---------------------------------

    Bug behavior facts: Data corruption
    
> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>              Labels: derby_triage10_8
>         Attachments: derby.log, derby4923repro.diff
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Rick Hillegas updated DERBY-4923:
---------------------------------

    Issue & fix info: High Value Fix,Repro attached  (was: High Value Fix)
    
> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>              Labels: derby_triage10_8
>         Attachments: DERBY_4923.java, derby.log, derby4923repro.diff
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Rick Hillegas commented on DERBY-4923:
--------------------------------------

Hi Mike,

This bug is assigned to you. Are you still working on it? Thanks.
                
> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>              Labels: derby_triage10_8
>         Attachments: derby.log, derby4923repro.diff
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Kathey Marsden updated DERBY-4923:
----------------------------------

    Labels: derby_triage10_10 derby_triage10_8  (was: derby_triage10_8)

Verified the repro attached still reproduces the error  against trunk and . The reproduction connects with an in-memory database so I didn't verify but presumably the original Data corruption flag is correct as well.  This would be great to get this one fixed for the next release. Do we have an idea of the scope of the work?

 

                
> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>              Labels: derby_triage10_10, derby_triage10_8
>         Attachments: DERBY_4923.java, derby4923repro.diff, derby-4923-tt-aa-NoSpaceOnPageExtendsException.diff, derby.log
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Rick Hillegas updated DERBY-4923:
---------------------------------

    Attachment: DERBY_4923.java

Attaching DERBY_4923.java. This reworks Mike's test case to be a standalone program rather than a JUnit test. If you run this with an insane engine, you get the stack trace indicated in this bug report. If you run this with a sane engine, you get an assertion.

I don't know if it's significant that the test case compresses the table. However, table compression certainly takes us through code which has given rise to a lot of bugs.
                
> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>              Labels: derby_triage10_8
>         Attachments: DERBY_4923.java, derby.log, derby4923repro.diff
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Rick Hillegas commented on DERBY-4923:
--------------------------------------

Thanks for that explanation, Mike. This observation particularly struck me:

"So at least in the cases that I have debugged in the past the bug is not in the operation that is failing, it is in a previous operation that lead to the page getting to state with not enough reserved space to do the operation."

This increases my suspicion that the attached repro may turn out to be another bug in table compression.

On the related issue DERBY-5858, table compression was not used. So there is at least another code path, not involving table compression, which sets up this NoSpaceOnPage condition.


                
> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>              Labels: derby_triage10_8
>         Attachments: DERBY_4923.java, derby-4923-tt-aa-NoSpaceOnPageExtendsException.diff, derby.log, derby4923repro.diff
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Kathey Marsden updated DERBY-4923:
----------------------------------

    Component/s: Store

> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>         Attachments: derby.log, derby4923repro.diff
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

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


[jira] [Updated] (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Rick Hillegas updated DERBY-4923:
---------------------------------

    Bug behavior facts:   (was: [Wrong query result])

Turning off the "Wrong query result" box. It seems to me that this bug does not return the wrong rows to the user. It raises an exception and fails.

> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>              Labels: derby_triage10_8
>         Attachments: derby.log, derby4923repro.diff
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

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

[jira] Updated: (DERBY-4923) update of a long row can fail with ERROR nospc: nospc.U exception.

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

Mike Matrigali updated DERBY-4923:
----------------------------------

    Attachment: derby.log
                derby4923repro.diff

derby4923repro.diff is a repro of the bug in the form of a junit test to be run from the codeline.  The attached derby.log shows the result from running it against a sane build.

> update of a long row can fail with ERROR nospc: nospc.U exception.
> ------------------------------------------------------------------
>
>                 Key: DERBY-4923
>                 URL: https://issues.apache.org/jira/browse/DERBY-4923
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.6.2.1
>            Reporter: Mike Matrigali
>            Assignee: Mike Matrigali
>         Attachments: derby.log, derby4923repro.diff
>
>
> An update of a row fails with a nospc.U exception.  If there is space on the disk then an update should never fail for a space 
> issue.  The code is meant to always reserve enough space on a page such that if an expanding update happens that does not
> fit, it should in the worst case change the row to an overflow row pointer and put the rest in a linked overflow chain.
> The following set of circumstances will cause this bug (not sure which are exactly needed - just what i did to
> cause the repro), I will be attaching a test case:
> The row being updated has the following characteristics:
>     o located on 4k page
>     o 2 colum row with 2nd column a blob column
>     o the row is a long row with first piece having 1st column on main page, and the 2nd piece having just blob column on overflow page.
>     o before the update there is 0 free space on the overflow page.
>     o the update causes the blob column to expand past 4k 
> Caused by: java.sql.SQLException: nospc.U
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>     at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>     ... 39 more
> Caused by: ERROR nospc: nospc.U
>     at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4155)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)
>     at org.apache.derby.impl.store.raw.data.UpdateOperation.<init>(UpdateOperation.java:106)
>     at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)
>     at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8625)
>     at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)
>     at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:486)
>     at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:569)
>     at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:264)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
>     at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
>     at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
>     ... 33 more

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