Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 28444 invoked from network); 28 Jun 2010 07:09:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Jun 2010 07:09:18 -0000 Received: (qmail 85038 invoked by uid 500); 28 Jun 2010 07:09:18 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 84785 invoked by uid 500); 28 Jun 2010 07:09:15 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 84759 invoked by uid 99); 28 Jun 2010 07:09:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jun 2010 07:09:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jun 2010 07:09:12 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o5S78oMR014257 for ; Mon, 28 Jun 2010 07:08:50 GMT Message-ID: <21219425.84451277708930691.JavaMail.jira@thor> Date: Mon, 28 Jun 2010 03:08:50 -0400 (EDT) From: "Kristian Waagan (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-4577) An expanding update fails with an nospc.U error. In-Reply-To: <24933604.111161267836207200.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kristian Waagan updated DERBY-4577: ----------------------------------- Component/s: Store > An expanding update fails with an nospc.U error. > ------------------------------------------------ > > Key: DERBY-4577 > URL: https://issues.apache.org/jira/browse/DERBY-4577 > Project: Derby > Issue Type: Bug > Components: Store > Affects Versions: 10.6.1.0 > Reporter: Mike Matrigali > Assignee: Mike Matrigali > Attachments: derby-4577.diff, derby-4577_fix.diff, derby-4577_not_for_commit_fix.diff > > > An update of a long row piece on an overflow page that has limited row used space, row reserved space, and page free space can throw the nospc.U error on an update. I will attach a patch with a simple junit test that reproduces this > issue. > This issue is probably the same as DERBY-2286. Logging a new issue so that it is clear the associated changes fix > the attached repro. The repro for DERBY-2286 is random and I could only get it to fail on one machine. If after the fix > for this goes in and no one can repro, then we can close DERBY-2286 as a repro. > The nospc errror is never meant to get to the user. The code path that can raise it is shared by insert and update. > Insert has code that internally catches the error and does the right thing. The error should never be raised for an update. What is meant to happen for updates is that on update on any page, including an overflow page should always > in the worst case have enough room to transform the row piece from whatever it is to a just a row header with an > overflow pointer to the next piece. > For the attached test the row piece on the overflow page is 12 bytes reserved, and 0 bytes free on the page. So > far in the code path the code has written a preliminary row header that is 4 bytes, and then has noticed that the > remaining 8 bytes are not enough for an overflow pointer (worst case 8 bytes for page number + 4 bytes for record > id). > I think the real problem is that not enough minimum space is being reserved on the overflow page. There should be > 12 bytes reserved + the maximum size of a record header that does not include an overflow pointer. I think the > code does the right thing in the case of head pages where the minimum reserved space is 12 for the "user" portion > of the data, but it looks like we don't apply this reserved space to just user portion on overflow pages. > I need to research more, but it looks like on overflow pages we apply the minimum reserved space to the entire row > rather than just the user space. > The stack trace being thrown in this case is: > 2010-03-06 00:18:40.750 GMT: > Booting Derby version The Apache Software Foundation - Apache Derby - 10.6.0.0 alpha - (1): instance 3405c0cb-0127-30d6-6168-ffffe7 > 008b2c > on database directory C:\derby\s2\systest\out\junit\system\wombat > ^M > Database Class Loader started - derby.database.classpath=''^M > 2010-03-06 00:18:41.171 GMT Thread[main,5,main] (XID = 253), (SESSIONID = 1), (DATABASE = wombat), (DRDAID = null), Cleanup action s > tarting^M > 2010-03-06 00:18:41.171 GMT Thread[main,5,main] (XID = 253), (SESSIONID = 1), (DATABASE = wombat), (DRDAID = null), Failed Statement > is: UPDATE testBadUpdate set value = ? where id = ? with 2 parameters begin parameter #1: BLOB:Length=120000 :end parameter begin p > arameter #2: 0 :end parameter ^M > ERROR nospc: nospc.U^M > at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:4106)^M > at org.apache.derby.impl.store.raw.data.UpdateOperation.writeOptionalDataToBuffer(UpdateOperation.java:255)^M > at org.apache.derby.impl.store.raw.data.UpdateOperation.(UpdateOperation.java:106)^M > at org.apache.derby.impl.store.raw.data.LoggableActions.actionUpdate(LoggableActions.java:80)^M > at org.apache.derby.impl.store.raw.data.StoredPage.doUpdateAtSlot(StoredPage.java:8551)^M > at org.apache.derby.impl.store.raw.data.BasePage.updateAtSlot(BasePage.java:1062)^M > at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:472) > ^M > at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:523)^M > at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:554)^M > at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:254)^M > at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)^M > at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)^M > at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1232)^M > at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1673)^M > at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:303)^M > at org.apache.derbyTesting.functionTests.tests.store.DerbyBugTest2.run_one(DerbyBugTest2.java:224)^M > at org.apache.derbyTesting.functionTests.tests.store.DerbyBugTest2.testOne(DerbyBugTest2.java:84)^M > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)^M > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)^M > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)^M > at java.lang.reflect.Method.invoke(Method.java:600)^M > at junit.framework.TestCase.runTest(TestCase.java:154)^M > at junit.framework.TestCase.runBare(TestCase.java:127)^M > at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)^M > at junit.framework.TestResult$1.protect(TestResult.java:106)^M > at junit.framework.TestResult.runProtected(TestResult.java:124)^M > at junit.framework.TestResult.run(TestResult.java:109)^M > at junit.framework.TestCase.run(TestCase.java:118)^M > at junit.framework.TestSuite.runTest(TestSuite.java:208)^M > at junit.framework.TestSuite.run(TestSuite.java:203)^M > at junit.framework.TestSuite.runTest(TestSuite.java:208)^M > at junit.framework.TestSuite.run(TestSuite.java:203)^M > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)^M > at junit.extensions.TestSetup$1.protect(TestSetup.java:19)^M > at junit.framework.TestResult.runProtected(TestResult.java:124)^M > at junit.extensions.TestSetup.run(TestSetup.java:23)^M > at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)^M > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)^M > at junit.extensions.TestSetup$1.protect(TestSetup.java:19)^M > at junit.framework.TestResult.runProtected(TestResult.java:124)^M > at junit.extensions.TestSetup.run(TestSetup.java:23)^M > at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)^M > at junit.framework.TestSuite.runTest(TestSuite.java:208)^M > at junit.framework.TestSuite.run(TestSuite.java:203)^M > at junit.textui.TestRunner.doRun(TestRunner.java:116)^M > at junit.textui.TestRunner.start(TestRunner.java:172)^M > at junit.textui.TestRunner.main(TestRunner.java:138)^M > Cleanup action completed^M -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.