Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 14703 invoked from network); 13 Mar 2008 21:40:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Mar 2008 21:40:09 -0000 Received: (qmail 84203 invoked by uid 500); 13 Mar 2008 21:39:59 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 84169 invoked by uid 500); 13 Mar 2008 21:39:59 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 84146 invoked by uid 99); 13 Mar 2008 21:39:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Mar 2008 14:39:59 -0700 X-ASF-Spam-Status: No, hits=-1998.8 required=10.0 tests=ALL_TRUSTED,FS_REPLICA X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Mar 2008 21:39:18 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5AD8F234C0A9 for ; Thu, 13 Mar 2008 14:38:24 -0700 (PDT) Message-ID: <1997316581.1205444304368.JavaMail.jira@brutus> Date: Thu, 13 Mar 2008 14:38:24 -0700 (PDT) From: =?utf-8?Q?=C3=98ystein_Gr=C3=B8vlen_=28JIRA=29?= To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-3382) Replication: Slave must inform master if DBs are out of sync. In-Reply-To: <21669427.1202121068877.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3382?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1257= 8502#action_12578502 ]=20 =C3=98ystein Gr=C3=B8vlen commented on DERBY-3382: ---------------------------------------- Thanks for the test, J=C3=B8rgen. 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.functionT= ests.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-re= pl/testing_repl/db_master"): error=3D2, 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.Rep= licationRun$4.run(ReplicationRun.java:2250) at java.lang.Thread.run(Thread.java:619) Caused by: java.io.IOException: error=3D2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.(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.consolePrope= rtyMessageWork(NetworkServerControlImpl.java:3173) at org.apache.derby.impl.drda.NetworkServerControlImpl.consolePrope= rtyMessage(NetworkServerControlImpl.java:1855) at org.apache.derby.impl.drda.NetworkServerControlImpl.setUpSocket(= NetworkServerControlImpl.java:2497) at org.apache.derby.impl.drda.NetworkServerControlImpl.ping(Network= ServerControlImpl.java:1138) at org.apache.derby.drda.NetworkServerControl.ping(NetworkServerCon= trol.java:395) at org.apache.derbyTesting.functionTests.tests.replicationTests.Rep= licationRun.ping(ReplicationRun.java:2600) at org.apache.derbyTesting.functionTests.tests.replicationTests.Rep= licationRun.pingServer(ReplicationRun.java:2587) at org.apache.derbyTesting.functionTests.tests.replicationTests.Rep= licationRun.startServer(ReplicationRun.java:2264) at org.apache.derbyTesting.functionTests.tests.replicationTests.Rep= licationRun_Local.testLogFilesSynched(ReplicationRun_Local.java:182) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor= Impl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod= AccessorImpl.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/li= b/../bin/java" (in directory "/export/tmp/oysteing/derby-repl/testing_repl/= export/tmp/oysteing/derby-repl/testing_repl/db_slave"): error=3D2, No such = file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.j= ava:459) at java.lang.Runtime.exec(Runtime.java:593) at java.lang.Runtime.exec(Runtime.java:431) at org.apache.derbyTesting.functionTests.tests.replicationTests.Rep= licationRun$4.run(ReplicationRun.java:2250) at java.lang.Thread.run(Thread.java:619) Caused by: java.io.IOException: error=3D2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.(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.consolePrope= rtyMessageWork(NetworkServerControlImpl.java:3173) at org.apache.derby.impl.drda.NetworkServerControlImpl.consolePrope= rtyMessage(NetworkServerControlImpl.java:1855) at org.apache.derby.impl.drda.NetworkServerControlImpl.setUpSocket(= NetworkServerControlImpl.java:2497) at org.apache.derby.impl.drda.NetworkServerControlImpl.ping(Network= ServerControlImpl.java:1138) at org.apache.derby.drda.NetworkServerControl.ping(NetworkServerCon= trol.java:395) at org.apache.derbyTesting.functionTests.tests.replicationTests.Rep= licationRun.ping(ReplicationRun.java:2600) at org.apache.derbyTesting.functionTests.tests.replicationTests.Rep= licationRun.pingServer(ReplicationRun.java:2587) at org.apache.derbyTesting.functionTests.tests.replicationTests.Rep= licationRun.startServer(ReplicationRun.java:2264) at org.apache.derbyTesting.functionTests.tests.replicationTests.Rep= licationRun_Local.testLogFilesSynched(ReplicationRun_Local.java:188) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor= Impl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod= AccessorImpl.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: =C3=98ystein Gr=C3=B8vlen > Assignee: J=C3=B8rgen L=C3=B8land > Fix For: 10.4.0.0 > > Attachments: derby-3382-1a.diff, derby-3382-1a.stat, derby-3382-1= b.diff, derby-3382-1b.stat, derby-3382-test-1a.diff, derby-3382-test-1a.sta= t > > > 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 bo= oting. The slave will then stop replication, but the master will not be no= tified. > If I then try to stop or failover the master the master will hang. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.