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

Øystein Grøvlen commented on DERBY-3382:
----------------------------------------

Thanks for the test, Jørgen.  Test case looks good, but I have a few
comments on the modifications to the framework:

1. I suggest renaming slaveConnException to startSlaveException to
   indicate that it is specific to startSlave command.

2. slaveConnException should be set to null before starting the slave
   in order to make it possible to start the slave more than once in
   the same test.

3. Are you sure it is a good idea to use the connection obtained when
   starting the master for further operations on the master.  Would it
   not be more general if it was a separate connection?  Anyhow, if
   ReplicationRun is to provide the capability to use an existing
   connection, I think getMasterConnection needs to be able to open a
   new connection should no one exist.  (An alternative would be to
   see if it was possible to let ReplicationRun extend
   BaseJDBCTestCase and use its connection handling for connecting to
   the master database.)

4. Why do you need to copy the code from
   BaseJDBCTestCase#assertSQLState? That method is static so you
   should be able to use it as it is.

5. assertSQLStateSlaveConn: Javadoc should state that it will wait for
   some time for start slave command to complete.  Instead of "Slave
   connection attempt hangs ...", I would prefer "Attempt to start
   slave hangs ...", or something like that.

6. If I run the replication suite with this patch from an empty
   directory, it fails.  This does not happen without the patch:

> java junit.textui.TestRunner -noloading 
> org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationSuite 
> ..java.io.IOException: Cannot run program 
> "/usr/local/java/jdk1.6.0_01/jre/lib/../bin/java" (in directory 
> "/export/tmp/oysteing/derby-repl/testing_repl/export/tmp/oysteing/derby-repl/testing_repl/db_master"):
>  error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
        at java.lang.Runtime.exec(Runtime.java:593)
        at java.lang.Runtime.exec(Runtime.java:431)
        at 
org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun$4.run(ReplicationRun.java:2250)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
        at java.lang.ProcessImpl.start(ProcessImpl.java:65)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
        ... 4 more
java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby Network Server on 
host 127.0.0.1, port 1527: Connection refused
        at 
org.apache.derby.impl.drda.NetworkServerControlImpl.consolePropertyMessageWork(NetworkServerControlImpl.java:3173)
        at 
org.apache.derby.impl.drda.NetworkServerControlImpl.consolePropertyMessage(NetworkServerControlImpl.java:1855)
        at 
org.apache.derby.impl.drda.NetworkServerControlImpl.setUpSocket(NetworkServerControlImpl.java:2497)
        at 
org.apache.derby.impl.drda.NetworkServerControlImpl.ping(NetworkServerControlImpl.java:1138)
        at 
org.apache.derby.drda.NetworkServerControl.ping(NetworkServerControl.java:395)
        at 
org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.ping(ReplicationRun.java:2600)
        at 
org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.pingServer(ReplicationRun.java:2587)
        at 
org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.startServer(ReplicationRun.java:2264)
        at 
org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local.testLogFilesSynched(ReplicationRun_Local.java:182)
        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:597)
        at junit.framework.TestCase.runTest(TestCase.java:164)
        at junit.framework.TestCase.runBare(TestCase.java:130)
        at 
org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:101)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:120)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at junit.textui.TestRunner.doRun(TestRunner.java:121)
        at junit.textui.TestRunner.start(TestRunner.java:185)
        at junit.textui.TestRunner.main(TestRunner.java:143)
java.io.IOException: Cannot run program 
"/usr/local/java/jdk1.6.0_01/jre/lib/../bin/java" (in directory 
"/export/tmp/oysteing/derby-repl/testing_repl/export/tmp/oysteing/derby-repl/testing_repl/db_slave"):
 error=2, No such file or directory        at 
java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
        at java.lang.Runtime.exec(Runtime.java:593)
        at java.lang.Runtime.exec(Runtime.java:431)
        at 
org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun$4.run(ReplicationRun.java:2250)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
        at java.lang.ProcessImpl.start(ProcessImpl.java:65)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
        ... 4 more
java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby Network Server on 
host 127.0.0.1, port 4527: Connection refused
        at 
org.apache.derby.impl.drda.NetworkServerControlImpl.consolePropertyMessageWork(NetworkServerControlImpl.java:3173)
        at 
org.apache.derby.impl.drda.NetworkServerControlImpl.consolePropertyMessage(NetworkServerControlImpl.java:1855)
        at 
org.apache.derby.impl.drda.NetworkServerControlImpl.setUpSocket(NetworkServerControlImpl.java:2497)
        at 
org.apache.derby.impl.drda.NetworkServerControlImpl.ping(NetworkServerControlImpl.java:1138)
        at 
org.apache.derby.drda.NetworkServerControl.ping(NetworkServerControl.java:395)
        at 
org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.ping(ReplicationRun.java:2600)
        at 
org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.pingServer(ReplicationRun.java:2587)
        at 
org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.startServer(ReplicationRun.java:2264)
        at 
org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local.testLogFilesSynched(ReplicationRun_Local.java:188)
        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:597)
        at junit.framework.TestCase.runTest(TestCase.java:164)
        at junit.framework.TestCase.runBare(TestCase.java:130)
        at 
org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:101)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:120)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at junit.textui.TestRunner.doRun(TestRunner.java:121)
        at junit.textui.TestRunner.start(TestRunner.java:185)
        at junit.textui.TestRunner.main(TestRunner.java:143)
E.^C
>


> Replication: Slave must inform master if DBs are out of sync.
> -------------------------------------------------------------
>
>                 Key: DERBY-3382
>                 URL: https://issues.apache.org/jira/browse/DERBY-3382
>             Project: Derby
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 10.4.0.0
>            Reporter: Øystein Grøvlen
>            Assignee: Jørgen Løland
>             Fix For: 10.4.0.0
>
>         Attachments: derby-3382-1a.diff, derby-3382-1a.stat, 
> derby-3382-1b.diff, derby-3382-1b.stat, derby-3382-test-1a.diff, 
> derby-3382-test-1a.stat
>
>
> If I copy the database to the slave before booting the master, slave will be 
> out of sync with the master since new log records are created during booting. 
>  The slave will then stop replication, but the master will not be notified.
> If I then try to stop or failover the master the master will hang.

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