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] [Commented] (DERBY-5894) NPE in OnlineBackupTest1 while backing up in stubFileToRemoveAfterCheckPoint
Date Tue, 11 Dec 2012 10:17:22 GMT

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

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

Synchronizing backupContainer() might fix this particular NPE, but it made some tests trip
over an assert in RAFContainer4.readPage(long,byte[],long). The problem is that readPage()
checks whether the call is synchronized, and behaves differently if it is. And backupContainer()
will end up calling readPage(), but now synchronized instead of unsynchronized, and this was
unexpected. See the description of "stealth mode" in DERBY-4741 for details.

Synchronization in backupContainer() is only needed in order to protect the actionCode, actionContainerHandle
and actionBackupLocation variables, and those variables are only needed because all of RAFContainer's
privileged operations share one run() method, I think it's just as reasonable to keep it unsynchronized
and instead let backupContainer() have its own run() method in an inner class. I even think
that it's a cleaner approach in general, both because it avoids this class of bugs, and because
it's more scalable as it avoids a global lock on the container for each privileged operation
(not that relevant for backup, though, but still...).

The tests that failed when RAFContainer.backupContainer() was made synchronized, were:

lang.DatabaseClassLoadingTest
lang.TruncateTableAndOnlineBackupTest

derbyall/storeall/storeall.fail:store/rollForwardBackup.sql
derbyall/storeall/storeall.fail:store/rollForwardRecovery.sql
derbyall/storeall/storeall.fail:store/backupRestore.sql
derbyall/storeall/storeall.fail:store/backupRestore1.java
derbyall/storeall/storeall.fail:store/OnlineBackupTest1.java
derbyall/storeall/storeall.fail:store/OnlineBackupTest3.java
derbyall/storeall/storeall.fail:storetests/st_1.sql
derbyall/encryptionAll/encryptionAll.fail:store/encryptDatabaseTest3.sql
                
> NPE in OnlineBackupTest1 while backing up in stubFileToRemoveAfterCheckPoint
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-5894
>                 URL: https://issues.apache.org/jira/browse/DERBY-5894
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>            Reporter: Dag H. Wanvik
>            Assignee: Knut Anders Hatlen
>              Labels: derby_triage10_10
>         Attachments: d5894.zip
>
>
> Saw this while running OnlineBackupTest1 trying to repro DERBY-973.
> ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while evaluating
an expression.
>         at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:288)
>         at org.apache.derby.iapi.error.StandardException.unexpectedUserException(StandardException.java:575)
>         at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMethod.java:63)
>         at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(CallStatementResultSet.java:75)
>         at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:443)
>         at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:324)
>         at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1242)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1715)
>         at org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(EmbedCallableStatement.java:118)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(EmbedPreparedStatement.java:1370)
>         at org.apache.derbyTesting.functionTests.tests.store.OnlineBackup.performBackup(OnlineBackup.java:89)
>         at org.apache.derbyTesting.functionTests.tests.store.OnlineBackup.run(OnlineBackup.java:60)
>         at java.lang.Thread.run(Thread.java:637)
> Caused by: java.lang.NullPointerException
>         at java.util.Hashtable.put(Hashtable.java:401)
>         at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.stubFileToRemoveAfterCheckPoint(BaseDataFileFactory.java:1613)
>         at org.apache.derby.impl.store.raw.data.RAFContainer.run(RAFContainer.java:1651)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at org.apache.derby.impl.store.raw.data.RAFContainer.backupContainer(RAFContainer.java:983)
>         at org.apache.derby.impl.store.raw.data.BaseContainerHandle.backupContainer(BaseContainerHandle.java:1031)
>         at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.backupDataFiles(BaseDataFileFactory.java:2466)
>         at org.apache.derby.impl.store.raw.RawStore.backup(RawStore.java:978)
>         at org.apache.derby.impl.store.raw.RawStore.backup(RawStore.java:649)
>         at org.apache.derby.impl.store.access.RAMAccessManager.backup(RAMAccessManager.java:964)
>         at org.apache.derby.impl.db.BasicDatabase.backup(BasicDatabase.java:430)
>         at org.apache.derby.catalog.SystemProcedures.SYSCS_BACKUP_DATABASE(SystemProcedures.java:961)
>         at org.apache.derby.exe.acf33d40c7x0138x6d7cx6df3x0000720ad17b0.g0(Unknown Source)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:592)
>         at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMethod.java:46)
>         ... 10 more

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