You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2012/10/01 15:39:08 UTC

[jira] [Updated] (DERBY-5937) File handle is leaked when a Slave replication is shutdown with failover=true

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

Knut Anders Hatlen updated DERBY-5937:
--------------------------------------

    Attachment: d5937-1a-test.diff

The patch d5937-1a-test.diff adds a regression test case that exposes the bug when run on Windows. The test case fails because it cannot delete all files in the slave database directory after shutdown:

<assertDirectoryDeleted> attempt 1 left 3 files/dirs behind: 0=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db\log\log1.dat 1=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db\log 2=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db
<assertDirectoryDeleted> attempt 2 left 3 files/dirs behind: 0=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db\log\log1.dat 1=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db\log 2=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db
<assertDirectoryDeleted> attempt 3 left 3 files/dirs behind: 0=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db\log\log1.dat 1=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db\log 2=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db
<assertDirectoryDeleted> attempt 4 left 3 files/dirs behind: 0=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db\log\log1.dat 1=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db\log 2=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db
F
Time: 18,891
There was 1 failure:
1) testSlaveFailoverLeak(org.apache.derbyTesting.functionTests.tests.replicationTests.Derby5937SlaveShutdownTest)junit.framework.AssertionFailedError: Failed to delete 3 files (root=C:\cygwin\home\lroot\derbytst\system\d5937-slave-db): C:\cygwin\home\lroot\derbytst\system\d5937-slave-db\log\log1.dat (isDir=false, canRead=true, canWrite=true, size=1048576), C:\cygwin\home\lroot\derbytst\system\d5937-slave-db\log (isDir=true, canRead=true, canWrite=true, size=0), C:\cygwin\home\lroot\derbytst\system\d5937-slave-db (isDir=true, canRead=true, canWrite=true, size=4096)
	at org.apache.derbyTesting.junit.BaseTestCase.assertDirectoryDeleted(BaseTestCase.java:1027)
	at org.apache.derbyTesting.functionTests.tests.replicationTests.Derby5937SlaveShutdownTest.testSlaveFailoverLeak(Derby5937SlaveShutdownTest.java:169)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
	at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
	at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
	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)

FAILURES!!!
Tests run: 1,  Failures: 1,  Errors: 0
                
> File handle is leaked when a Slave replication is shutdown with failover=true
> -----------------------------------------------------------------------------
>
>                 Key: DERBY-5937
>                 URL: https://issues.apache.org/jira/browse/DERBY-5937
>             Project: Derby
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 10.8.2.2
>         Environment: Windows 7
>            Reporter: Glenn McGregor
>            Assignee: Knut Anders Hatlen
>              Labels: derby_triage10_10
>         Attachments: d5937-1a-test.diff
>
>
> As part of our use of derby replication, we shut the slave down if we detect reachability issues with the master. Normally we shut it down, and bring it back up as a regular database in read-only mode.  Then when the master can, it tries to push a fresh copy back to the slave system. However, during the failover=true shutdown on the slave, the log file  ".../name/log/log1.dat" is still open. 
> Because of this open file, at least on Windows, it's impossible to move the database file out of the way, and to install a fresh copy from the master.

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