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

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

Thanks for the new patch, Dag. Some more comments:

1) typo in javadoc: SYS:SYSSCHEMAS -> SYS.SYSSCHEMAS (colon -> comma)

2) Message for SQLState.RAWSTORE_RECORD_VANISHED needs a parameter (recordName)

3) In the code below, couldn't the nested if statements be combined into a 
single one? Then the debug code doesn't have to be reindented.
+                               if (! base_row_exists) {
+                                       if (isolationLevel ==
+                                                       
TransactionController.ISOLATION_REPEATABLE_READ) {
--> if (!base_row_exists && isolationLevel == ...)

4) I don't know the store API well enough to say whether the code is correct or 
not, but isn't there a risk in getDescriptorViaIndexMinion() that 
heapCC.fetch() reads the wrong row, as the row isn't protected by a lock 
between retrieving the row location from the index and actually reading the 
value?

5) If getDescriptorViaIndex() only supports repeatable read and read 
uncommitted, should it have an assert so that no one accidentally calls it with 
another isolation level?

> StackOverflowException in deadlock trace
> ----------------------------------------
>
>                 Key: DERBY-3678
>                 URL: https://issues.apache.org/jira/browse/DERBY-3678
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.3.2.1
>         Environment: (this is actually in version 10.3.2.2)
> MacOS 10, JDK 1.6
>            Reporter: geoff hendrey
>            Assignee: Dag H. Wanvik
>             Fix For: 10.5.0.0
>
>         Attachments: derby-3678-1.diff, derby-3678-1.stat, derby-3678-2.diff, 
> derby-3678-2.stat
>
>
> I am getting a deadlock in SYSTABLE. When I turn on 
> Dderby.locks.deadlockTrace=true, I get a StackOverflowException
> Derby version The Apache Software Foundation - Apache Derby - 10.3.2.2
> - (618335): instance 80220011-0119-f93f-b912-00000000bced
> on database directory /db/domains/geoff  
> Database Class Loader started - derby.database.classpath=''
> 2008-05-17 23:44:36.380
> GMT Thread[btpool0-2,5,main] (XID = 7556), (SESSIONID = 4), (DATABASE =
> domains/geoff), (DRDAID = null), Cleanup action starting
> java.lang.StackOverflowError
>         at 
> org.apache.derby.impl.sql.execute.GenericExecutionFactory.getValueRow(Unknown 
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.SYSCONGLOMERATESRowFactory.makeRow(Unknown 
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.SYSCONGLOMERATESRowFactory.makeEmptyRow(Unknown
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.hashAllConglomerateDescriptorsByNumber(Unknown
> Source)
>         at org.apache.derby.impl.services.locks.TableNameInfo.<init>(Unknown 
> Source)
>         at 
> org.apache.derby.impl.services.locks.Timeout.buildLockTableString(Unknown 
> Source)
>         at 
> org.apache.derby.impl.services.locks.Timeout.createException(Unknown Source)
>         at 
> org.apache.derby.impl.services.locks.Timeout.buildException(Unknown Source)
>         at 
> org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown 
> Source)
>         at 
> org.apache.derby.impl.services.locks.AbstractPool.lockObject(Unknown Source)
>         at 
> org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(Unknown Source)
>         at 
> org.apache.derby.impl.store.raw.xact.RowLocking3.lockRecordForRead(Unknown 
> Source)
>         at 
> org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown Source)
>         at 
> org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown Source)
>         at 
> org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.lockRowOnPage(Unknown
> Source)
>         at 
> org.apache.derby.impl.store.access.btree.index.B2IRowLocking3._lockScanRow(Unknown
> Source)
>         at 
> org.apache.derby.impl.store.access.btree.index.B2IRowLockingRR.lockScanRow(Unknown
> Source)
>         at 
> org.apache.derby.impl.store.access.btree.BTreeForwardScan.fetchRows(Unknown 
> Source)
>         at org.apache.derby.impl.store.access.btree.BTreeScan.next(Unknown 
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaIndex(Unknown
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.locateSchemaRow(Unknown 
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getSchemaDescriptor(Unknown
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.SYSTABLESRowFactory.buildDescriptor(Unknown 
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.hashAllTableDescriptorsByTableId(Unknown
> Source)
>         at org.apache.derby.impl.services.locks.TableNameInfo.<init>(Unknown 
> Source)
>         at 
> org.apache.derby.impl.services.locks.Timeout.buildLockTableString(Unknown 
> Source)
>         at 
> org.apache.derby.impl.services.locks.Timeout.createException(Unknown Source)
>         at 
> org.apache.derby.impl.services.locks.Timeout.buildException(Unknown Source)
>         at 
> org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown 
> Source)
>         at 
> org.apache.derby.impl.services.locks.AbstractPool.lockObject(Unknown Source)
>         at 
> org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(Unknown Source)
>         at 
> org.apache.derby.impl.store.raw.xact.RowLocking3.lockRecordForRead(Unknown 
> Source)
>         at 
> org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown Source)
>         at 
> org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown Source)
>         at 
> org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.lockRowOnPage(Unknown
> Source)
>         at 
> org.apache.derby.impl.store.access.btree.index.B2IRowLocking3._lockScanRow(Unknown
> Source)
>         at 
> org.apache.derby.impl.store.access.btree.index.B2IRowLockingRR.lockScanRow(Unknown
> Source)
>         at 
> org.apache.derby.impl.store.access.btree.BTreeForwardScan.fetchRows(Unknown 
> Source)
>         at org.apache.derby.impl.store.access.btree.BTreeScan.next(Unknown 
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaIndex(Unknown
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.locateSchemaRow(Unknown 
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getSchemaDescriptor(Unknown
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.SYSTABLESRowFactory.buildDescriptor(Unknown 
> Source)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.hashAllTableDescriptorsByTableId(Unknown
> Source)

-- 
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