[ 
https://issues.apache.org/jira/browse/DERBY-4275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-4275:
--------------------------------------

    Attachment: D4275.java

When I combined the invalidation-during-compilation.diff patch with the patch 
for DERBY-5161 (which had to be backed out because of DERBY-5280), I didn't see 
the error on commit anymore. I've been testing the patches by running three 
parallel processes of the attached Java program D4275.java.

However, after 12 minutes, one of the test processes failed with a 
NullPointerException:

java.lang.NullPointerException
        at 
org.apache.derby.impl.sql.compile.FromBaseTable.getStoreCostController(FromBaseTable.java:4515)
        at 
org.apache.derby.impl.sql.compile.FromBaseTable.getBaseCostController(FromBaseTable.java:4521)
        at 
org.apache.derby.impl.sql.compile.FromBaseTable.estimateCost(FromBaseTable.java:1428)
        at 
org.apache.derby.impl.sql.compile.OptimizerImpl.estimateTotalCost(OptimizerImpl.java:2626)
        at 
org.apache.derby.impl.sql.compile.OptimizerImpl.costBasedCostOptimizable(OptimizerImpl.java:2172)
        at 
org.apache.derby.impl.sql.compile.OptimizerImpl.costOptimizable(OptimizerImpl.java:1985)
        at 
org.apache.derby.impl.sql.compile.FromBaseTable.optimizeIt(FromBaseTable.java:524)
        at 
org.apache.derby.impl.sql.compile.ProjectRestrictNode.optimizeIt(ProjectRestrictNode.java:316)
        at 
org.apache.derby.impl.sql.compile.OptimizerImpl.costPermutation(OptimizerImpl.java:1939)
        at 
org.apache.derby.impl.sql.compile.SelectNode.optimize(SelectNode.java:1913)
        at 
org.apache.derby.impl.sql.compile.DMLStatementNode.optimizeStatement(DMLStatementNode.java:315)
        at 
org.apache.derby.impl.sql.compile.CursorNode.optimizeStatement(CursorNode.java:587)
        at 
org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:384)
        at 
org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:85)
        at 
org.apache.derby.impl.sql.GenericPreparedStatement.rePrepare(GenericPreparedStatement.java:231)
        at 
org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:412)
        at 
org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:319)
        at 
org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1242)
        at 
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1686)
        at 
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(EmbedPreparedStatement.java:284)
        at D4275$1.run0(D4275.java:35)
        at D4275$1.run(D4275.java:23)

I don't know if this is caused by the fix, or if it's some other existing 
problem that popped up by coincidence. The other two test processes didn't show 
any problems, and I terminated them after 30 minutes. Before I included the 
DERBY-5161 fix, the test would typically fail in less than a minute.

If DERBY-5161 + invalidation-during-compilation.diff (+ whatever extra is 
needed to fix the NPE) is the right solution for this issue, we'll need to find 
out how to reintroduce the DERBY-5161 fix without reintroducing DERBY-5280.

> Query executions fail when compressing a table using 
> SYSCS_UTIL.SYSCS_COMPRESS_TABLE
> ------------------------------------------------------------------------------------
>
>                 Key: DERBY-4275
>                 URL: https://issues.apache.org/jira/browse/DERBY-4275
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.4.1.3
>            Reporter: Sai Pullabhotla
>            Assignee: Knut Anders Hatlen
>              Labels: derby_triage10_5_2
>             Fix For: 10.8.1.6, 10.9.0.0
>
>         Attachments: CompressDBTest1.java, CompressDBTest2.java, D4275.java, 
> d4275-1a.diff, invalidate-after.diff, invalidation-during-compilation.diff
>
>
> Query executions (SELECT and/or UPDATE) fail with serious exceptions while 
> the table is being compressed using SYSCS_UTIL.SYSCS_COMPRESS_ TABLE. The 
> compression eventually finishes normally, but the queries keep failing with 
> the same error until the database is rebooted. More information about this 
> can be found on the Derby mailing list at 
> http://www.nabble.com/Issue-with-SYSCS_UTIL.SYSCS_COMPRESS_-TABLE-td23892893.html.
>  The exception stacktrace is below: 
> Caused by: java.sql.SQLException: The conglomerate (71,409) requested does 
> not exist.
>             at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
>             at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown 
> Source)
>             at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown 
> Source)
>             at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown 
> Source)
>             at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
>             at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
>             at 
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
>             at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown 
> Source)
>             at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)
>             at 
> org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
>             ... 25 more
>         Caused by: ERROR XSAI2: The conglomerate (71,409) requested does not 
> exist.
>             at 
> org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
>             at 
> org.apache.derby.impl.store.access.btree.index.B2IFactory.readConglomerate(Unknown
>  Source)
>             at 
> org.apache.derby.impl.store.access.RAMAccessManager.conglomCacheFind(Unknown 
> Source)
>             at 
> org.apache.derby.impl.store.access.RAMTransaction.findExistingConglomerate(Unknown
>  Source)
>             at 
> org.apache.derby.impl.store.access.RAMTransaction.openScan(Unknown Source)
>             at 
> org.apache.derby.impl.store.access.BackingStoreHashTableFromScan.<init>(Unknown
>  Source)
>             at 
> org.apache.derby.impl.store.access.RAMTransaction.createBackingStoreHashtableFromScan(Unknown
>  Source)
>             at 
> org.apache.derby.impl.sql.execute.HashScanResultSet.openCore(Unknown Source)
>             at 
> org.apache.derby.impl.sql.execute.JoinResultSet.openRight(Unknown Source)
>             at 
> org.apache.derby.impl.sql.execute.JoinResultSet.openCore(Unknown Source)
>             at 
> org.apache.derby.impl.sql.execute.JoinResultSet.openCore(Unknown Source)
>             at 
> org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(Unknown 
> Source)
>             at 
> org.apache.derby.impl.sql.execute.UnionResultSet.getNextRowCore(Unknown 
> Source)
>             at 
> org.apache.derby.impl.sql.execute.SortResultSet.getRowFromResultSet(Unknown 
> Source)
>             at 
> org.apache.derby.impl.sql.execute.SortResultSet.getNextRowFromRS(Unknown 
> Source)
>             at 
> org.apache.derby.impl.sql.execute.SortResultSet.loadSorter(Unknown Source)
>             at 
> org.apache.derby.impl.sql.execute.SortResultSet.openCore(Unknown Source)
>             at 
> org.apache.derby.impl.sql.execute.SortResultSet.openCore(Unknown Source)
>             at 
> org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source)
>             at 
> org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) 

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

        

Reply via email to