db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-6314) Upgrade from 10.10 fails with ClassCastException
Date Tue, 27 Aug 2013 09:32:51 GMT

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

Knut Anders Hatlen updated DERBY-6314:
--------------------------------------

    Issue & fix info:   (was: Patch Available)
            Assignee: Knut Anders Hatlen

I don't think we need to backport any of this to 10.10 at the moment.

We may want to backport the upgrade fix (the 1a patch) because it makes upgrade more robust
in case any future changes on the 10.10 branch changes the serialized format of the stored
query plan.

Backporting the 2a patch may be more problematic. Not for the case of upgrade from 10.10.1.1
to a later release produced from the 10.10 branch, but for the case of downgrading from that
later 10.10 release back to 10.10.1.1. Since the 2a patch changes the format of the stored
plan, and 10.10.1.1 does not have the upgrade fix, downgrade from 10.10.x to 10.10.1.1 will
attempt to read the newer plan and fail. (Possible workaround: call SYSCS_INVALIDATE_STORED_STATEMENTS
with 10.10.x before downgrading)

So I'm leaning towards backporting 1a and not backporting 2a for now.
                
> Upgrade from 10.10 fails with ClassCastException
> ------------------------------------------------
>
>                 Key: DERBY-6314
>                 URL: https://issues.apache.org/jira/browse/DERBY-6314
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.11.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: d6314-1a.diff, d6314-2a.diff
>
>
> I noticed that after running the SignatureChecker tool on a database with version 10.10.1.1,
I could not boot it with trunk (neither hard nor soft upgrade worked).
> To reproduce, create a database and run SignatureChecker with 10.10:
> $ java -jar /code/derby/oldreleases/10.10.1.1/derbyrun.jar SignatureChecker 'jdbc:derby:db;create=true'
> Then, try to boot that database with trunk:
> $ java -Dderby.database.allowPreReleaseUpgrade=true -jar /code/derby/trunk/jars/sane/derbyrun.jar
SignatureChecker 'jdbc:derby:db'             
> java.lang.reflect.InvocationTargetException
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at org.apache.derby.tools.SignatureChecker.getJ2SEConnection(SignatureChecker.java:445)
> 	at org.apache.derby.tools.SignatureChecker.execute(SignatureChecker.java:140)
> 	at org.apache.derby.tools.SignatureChecker.main(SignatureChecker.java:121)
> 	at org.apache.derby.iapi.tools.run.main(run.java:61)
> Caused by: java.sql.SQLException: Failed to start database 'db' with class loader sun.misc.Launcher$AppClassLoader@7e820d53,
see the next exception for details.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:103)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:137)
> 	at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:310)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2841)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:404)
> 	at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(InternalDriver.java:628)
> 	at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:282)
> 	at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:913)
> 	at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:147)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:571)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:233)
> 	... 8 more
> Caused by: java.sql.SQLException: Failed to start database 'db' with class loader sun.misc.Launcher$AppClassLoader@7e820d53,
see the next exception for details.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:141)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:73)
> 	... 18 more
> Caused by: java.sql.SQLException: Exception during restore of a serializable or SQLData
object of class 
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:141)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:73)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:288)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2835)
> 	... 15 more
> Caused by: ERROR XSDA8: Exception during restore of a serializable or SQLData object
of class 
> 	at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:265)
> 	at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5827)
> 	at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1514)
> 	at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:441)
> 	at org.apache.derby.impl.store.raw.data.CachedPage.fetchFromSlot(CachedPage.java:53)
> 	at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.fetch(GenericConglomerateController.java:299)
> 	at org.apache.derby.impl.sql.catalog.TabInfoImpl.deleteRows(TabInfoImpl.java:725)
> 	at org.apache.derby.impl.sql.catalog.TabInfoImpl.deleteRow(TabInfoImpl.java:570)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropSPSDescriptor(DataDictionaryImpl.java:4673)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropSPSDescriptor(DataDictionaryImpl.java:4647)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(DataDictionaryImpl.java:14121)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(DataDictionaryImpl.java:14135)
> 	at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(DD_Version.java:539)
> 	at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:238)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:7984)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:818)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1991)
> 	at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:541)
> 	at org.apache.derby.impl.services.monitor.FileMonitor.startModule(FileMonitor.java:44)
> 	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:423)
> 	at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:196)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1991)
> 	at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1819)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1685)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1569)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:988)
> 	at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:546)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2802)
> 	... 15 more
> Caused by: java.io.StreamCorruptedException: java.lang.ClassCastException: java.io.ObjectInputStream
cannot be cast to org.apache.derby.iapi.services.io.ErrorInfo
> 	at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:139)
> 	at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(ArrayUtil.java:180)
> 	at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(GenericStorablePreparedStatement.java:232)
> 	at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
> 	at org.apache.derby.iapi.types.UserType.readExternal(UserType.java:299)
> 	at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5684)
> 	... 43 more
> Caused by: java.lang.ClassCastException: java.io.ObjectInputStream cannot be cast to
org.apache.derby.iapi.services.io.ErrorInfo
> 	at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:97)
> 	... 48 more
> Could not get a connection.

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

Mime
View raw message