Issue Details (XML | Word | Printable)

Key: DERBY-3709
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Ole Solberg
Reporter: Knut Anders Hatlen
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Derby

Exception printed by replication test: Could not perform operation because the database is not in replication master mode.

Created: 04/Jun/08 09:14 PM   Updated: 29/Jun/09 10:43 PM
Component/s: Replication
Affects Version/s: 10.4.2.0, 10.5.1.1
Fix Version/s: 10.4.2.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works derby-3709_p1-v2.diff.txt 2008-06-09 10:47 AM Ole Solberg 1 kB
Text File Licensed for inclusion in ASF works derby-3709_p1.diff.txt 2008-06-06 12:30 PM Ole Solberg 0.9 kB
Environment:
Java Version: 1.6.0_04
Java Vendor: Sun Microsystems Inc.
OS name: SunOS
OS architecture: x86
OS version: 5.10
Issue Links:
Reference

Bug behavior facts: Regression Test Failure
Resolution Date: 05/Aug/08 02:34 PM


 Description  « Hide
I saw the following exception printed when I ran suites.All on trunk (revision 663064). None of the tests failed.

java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XRE07, SQLERRMC: Could not perform operation because the database is not in replication master mode.
at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:96)
at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:362)
at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:149)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:207)
at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.failOver_direct(ReplicationRun.java:1286)
at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.failOver(ReplicationRun.java:1220)
at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local.testReplication_Local(ReplicationRun_Local.java:148)
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:104)
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.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)
Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XRE07, SQLERRMC: Could not perform operation because the database is not in replication master mode.
at org.apache.derby.client.am.Connection.completeSqlca(Connection.java:2068)
at org.apache.derby.client.net.NetConnectionReply.parseRdbAccessFailed(NetConnectionReply.java:537)
at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(NetConnectionReply.java:430)
at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(NetConnectionReply.java:294)
at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(NetConnectionReply.java:121)
at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(NetConnection.java:831)
at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessRdb(NetConnection.java:755)
at org.apache.derby.client.net.NetConnection.flowUSRIDONLconnect(NetConnection.java:588)
at org.apache.derby.client.net.NetConnection.flowConnect(NetConnection.java:395)
at org.apache.derby.client.net.NetConnection.<init>(NetConnection.java:219)
at org.apache.derby.client.net.NetConnection40.<init>(NetConnection40.java:77)
at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(ClientJDBCObjectFactoryImpl40.java:269)
at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:140)
... 31 more

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
V.Narayanan added a comment - 05/Jun/08 11:04 AM
I remember while working on 3617 thinking that this might be because the
tests call failover immediately after a start master, this results in failover
being called before replication can be booted completely. I will take a closer
look at this over the weekend, unless someone beats me to it.

Ole Solberg added a comment - 06/Jun/08 12:28 PM
I think DERBY-3632 patch derby-3632_p1.diff.txt might "solve"/bypass the main problem here: that failover is attempted before replication is ready.

The test should however also catch the unexpected exception so that the failure is not hidden: I will upload a patch for this.

Ole Solberg added a comment - 06/Jun/08 12:30 PM
Catch the unexpected exception so that the failure is not hidden.

Ole Solberg made changes - 06/Jun/08 12:30 PM
Field Original Value New Value
Attachment derby-3709_p1.diff.txt [ 12383554 ]
V.Narayanan made changes - 08/Jun/08 05:48 PM
Link This issue relates to DERBY-3632 [ DERBY-3632 ]
V.Narayanan added a comment - 08/Jun/08 06:10 PM
1) Can't we just leave the 'else' and the catch(Exception ex) parts since the method is already
    throwing an Exception?
2) I am not sure this usage assertTrue(msg, false); is right, I guess the aim is to print msg all the time.
    Do we need to use assertTrue in this case?

Also, I will get 3632 in first and then switch to this issue.

Knut Anders Hatlen added a comment - 08/Jun/08 06:21 PM
Hi Narayanan,

1) I agree. The if/else part could probably be replaced with a call to BaseJDBCTestCase.assertSQLState(), and the "catch (Exception e)" part could probably be removed.

2) I think you're right. assertTrue(msg, false) should be replaced with fail(msg). And if we don't catch the exceptions, as you suggested in (1), we don't need that call at all.

Ole Solberg added a comment - 09/Jun/08 10:47 AM
You are of course right, on both 1) and 2).
This patch should take care of your suggested simplification.
Thanks for catching this!

ReplicationSuite ran OK with this patch.

Ole Solberg made changes - 09/Jun/08 10:47 AM
Attachment derby-3709_p1-v2.diff.txt [ 12383678 ]
V.Narayanan made changes - 09/Jun/08 11:59 AM
Assignee Ole Solberg [ olesolberg ]
V.Narayanan added a comment - 09/Jun/08 12:00 PM - edited
Thank you for the patch Ole! Shall run tests and commit tonight or early tomorrow morning.
I have my hands full now (sorry that I can't commit this immediately)! Also should this change be reflected in the 10.4 branch also?

Ole Solberg added a comment - 09/Jun/08 12:24 PM
Yes, this should be merged to 10.4 also (derby-3632_p1.diff.txt + derby-3709_p1-v2.diff.txt).
Thanks for handling this Narayanan!

Ole Solberg made changes - 09/Jun/08 12:25 PM
Derby Info [Patch Available]
Affects Version/s 10.4.1.4 [ 12313112 ]
Repository Revision Date User Message
ASF #666006 Tue Jun 10 08:30:41 UTC 2008 vnarayanan DERBY-3709

Changes the replication test to ensure that the failure due
to failover being started before replication is booted is
not hidden

Patch Contributor: Ole Soldberg
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java

V.Narayanan added a comment - 10/Jun/08 08:32 AM - edited
Thank you for the patch Ole

I had two unrelated failures while running these tests

Sending java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java
Transmitting file data .
Committed revision 666006.

Will merge it to 10.4 after running tests

Ole Solberg made changes - 11/Jun/08 06:53 AM
Link This issue is related to DERBY-3719 [ DERBY-3719 ]
Repository Revision Date User Message
ASF #666631 Wed Jun 11 12:16:02 UTC 2008 vnarayanan DERBY-3709

Changes the replication test to ensure that the failure due
to failover being started before replication is booted is
not hidden

Patch Contributor: Ole Soldberg
Files Changed
MODIFY /db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java

V.Narayanan added a comment - 11/Jun/08 12:27 PM
merged with 10.4. The tests in my environment were blubbering incoherently as usual :-/

Sending java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java
Transmitting file data .
Committed revision 666631.

Ole Solberg added a comment - 18/Jun/08 06:40 AM
Patch has been applied (trunk and merged to 10.4).

Ole Solberg made changes - 18/Jun/08 06:40 AM
Derby Info [Patch Available]
Rick Hillegas added a comment - 04/Aug/08 08:45 PM
Marking as Fix Version 10.4.2 because the fix has been ported to the 10.4 branch.

Rick Hillegas made changes - 04/Aug/08 08:45 PM
Fix Version/s 10.4.2.0 [ 12313345 ]
Rick Hillegas added a comment - 05/Aug/08 02:27 PM
Can this issue be marked as resolved now?

Ole Solberg added a comment - 05/Aug/08 02:34 PM
Resolving: applied to trunk and 10.4.

Ole Solberg made changes - 05/Aug/08 02:34 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Knut Anders Hatlen made changes - 25/Apr/09 05:21 PM
Status Resolved [ 5 ] Closed [ 6 ]
Myrna van Lunteren made changes - 04/May/09 06:22 PM
Affects Version/s 10.5.0.0 [ 12313010 ]
Affects Version/s 10.5.1.1 [ 12313771 ]
Dag H. Wanvik made changes - 29/Jun/09 10:40 PM
Derby Categories [Regression Test Failure]
Dag H. Wanvik made changes - 29/Jun/09 10:43 PM
Component/s Regression Test Failure [ 12310664 ]