[ 
https://issues.apache.org/jira/browse/DERBY-4097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12683190#action_12683190
 ] 

Knut Anders Hatlen commented on DERBY-4097:
-------------------------------------------

More detailed stack trace is available here:
http://dbtg.thresher.com/derby/test/tinderbox_trunk16/jvm1.6/testing/testlog/SunOS-5.10_i86pc-i386/755167-org.apache.derbyTesting.functionTests.suites.All_diff.txt

Caused by: org.apache.derby.client.am.SqlException: Error for batch element 
#67: Java exception: 'org.apache.derby.impl.store.access.btree.WaitError: '.
        at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
        at 
org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown 
Source)
        at org.apache.derby.client.net.NetStatementReply.readExecute(Unknown 
Source)
        at org.apache.derby.client.net.StatementReply.readExecute(Unknown 
Source)
        at 
org.apache.derby.client.net.NetPreparedStatement.readExecute_(Unknown Source)
        at org.apache.derby.client.am.PreparedStatement.readExecute(Unknown 
Source)
        ... 44 more

The WaitError is probably thrown by BTreeController.comparePreviousRecord() 
when it tries to walk backwards in the B-tree and cannot latch the left sibling 
page without waiting (probably because post commit work is done on that page by 
a different thread simultaneously). This is an intended feature of the current 
implementation, I think.

There are a couple of alternatives:

* comparePreviousRecord() could release its latches and return RESCAN_REQUIRED 
when it detects a WaitError

* A reimplementation of the nullable unique constraint insert code has been 
suggested [1] and it would probably fix this issue. Then the test would fail 
intermittently for a while, but it may be possible to rewrite the test to 
prevent it. (I think we could turn off auto-commit and run the test in one 
transaction. Then there won't be post-commit work done in parallel with the 
execution of the test, and I think it will still expose the bug that it was 
supposed to expose, but I would have to test that to be sure.)

[1] 
<URL:http://mail-archives.apache.org/mod_mbox/db-derby-dev/200903.mbox/%[email protected]%3e>
 

> 'testMixedInsertDelete(org.apache.derbyTesting.functionTests.tests.lang.NullableUniqueConstraintTest)org.apache.derby.client.am.BatchUpdateException'
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4097
>                 URL: https://issues.apache.org/jira/browse/DERBY-4097
>             Project: Derby
>          Issue Type: Bug
>          Components: Regression Test Failure
>    Affects Versions: 10.5.0.0
>         Environment: OS: 
> Solaris 9 9/04 s9s_u7wos_09 SPARC 64bits 
> SunOS 5.9 Generic_118558-11
> JVM: 
> Sun Microsystems Inc.
> java version "1.5.0_14"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode)
> OS:
> Solaris 10 5/08 s10x_u5wos_10 X86 64bits
> SunOS 5.10 Generic_127128-11
> JVM:
> Sun Microsystems Inc.
> java version "1.5.0_14"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode)
>            Reporter: Ole Solberg
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: batchexception.diff
>
>
> Seen twice....
> See 
> http://dbtg.thresher.com/derby/test/trunk15/jvm1.5/testing/testlog/SunOS-5.9_sun4u-sparc/754716-org.apache.derbyTesting.functionTests.suites.All_diff.txt
> http://dbtg.thresher.com/derby/test/trunk15/jvm1.5/testing/testlog/SunOS-5.10_i86pc-i386/753342-org.apache.derbyTesting.functionTests.suites.All_diff.txt
> 1) 
> testMixedInsertDelete(org.apache.derbyTesting.functionTests.tests.lang.NullableUniqueConstraintTest)org.apache.derby.client.am.BatchUpdateException:
>  Non-atomic batch failure.  The batch was submitted, but at least one 
> exception occurred on an individual member of the batch. Use 
> getNextException() to retrieve the exceptions for specific batched elements.
>       at org.apache.derby.client.am.Agent.endBatchedReadChain(Unknown Source)
>       at 
> org.apache.derby.client.am.PreparedStatement.executeBatchRequestX(Unknown 
> Source)
>       at org.apache.derby.client.am.PreparedStatement.executeBatchX(Unknown 
> Source)
>       at org.apache.derby.client.am.PreparedStatement.executeBatch(Unknown 
> Source)
>       at 
> org.apache.derbyTesting.functionTests.tests.lang.NullableUniqueConstraintTest.testMixedInsertDelete(NullableUniqueConstraintTest.java:481)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at 
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:105)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at 
> org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
>       at junit.extensions.TestSetup.run(TestSetup.java:25)
>       at 
> org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

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

Reply via email to