db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3417) slave side stop in a client server mode results in SQLState printed without proper error message
Date Wed, 22 Apr 2009 23:12:47 GMT

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

Dag H. Wanvik commented on DERBY-3417:
--------------------------------------

I think some of the brittleness of the replication tests can be
attributed to the fact that they run by default on localhost, using
client/Server Derby instances, and the timeout in the message
transmission layer is fixed at 5 seconds:

org.apache.derby.impl.store.replication.net.ReplicationMessageTransmit:
    :
    private final int DEFAULT_MESSAGE_RESPONSE_TIMEOUT = 5000;

This is not only the default actually; there is currently no way to
override it. In some failing tests I see XRE04
(REPLICATION_CONNECTION_LOST) as the root cause of other exceptions,
see example below. By upping this time constant this class or errors
went away. Since I was working on my machine while the tests were
running that could explain why I see more intermittent errors than is
usually seen on the test machines.

For the example test (ReplicationRun_Local_StateTest_part1_3), when I
increase DEFAULT_MESSAGE_RESPONSE_TIMEOUT, this error goes
away. Conversely, if I reduced it the frequency of errors increase.

I think this constant should be settable with a property for the end
user or maybe just increased, since not every application of
replication can assume machines with light load. I am unsure if
increasing the timeout will have any negative effect (error detection
latency springs to mind). What do you think?



Example error seen:
------------------
1) testReplication_Local_StateTest_part1_3(org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_StateTest_part1_3)junit.framework.ComparisonFailure:
connectionURL  failed: -1 XRE21 DERBY SQL error: SQLCODE: -1, SQLSTATE: XRE21, SQLERRMC: Error
occurred while performing failover for database '/export/home/dag/java/sb/tests/derby-3417-replicationTests.ReplicationRun_Local_StateTest_part1_3-sb.sb4.classes-1.6.0_13-14549/db_master/wombat',
Failover attempt was aborted.::SQLSTATE: XRE04Connection lost for replicated database 'null'.
expected:<XRE2[0]> but was:<XRE2[1]>
	at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:762)
	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_StateTest_part1_3._testPostStartedMasterAndSlave_Failover(ReplicationRun_Local_StateTest_part1_3.java:181)
	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_StateTest_part1_3.testReplication_Local_StateTest_part1_3(ReplicationRun_Local_StateTest_part1_3.java:123)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:105)
	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)

Caused by: java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XRE21, SQLERRMC:
Error occurred while performing failover for database '/export/home/dag/java/sb/tests/derby-3417-replicationTests.ReplicationRun_Local_StateTest_part1_3-sb.sb4.classes-1.6.0_13-14549/db_master/wombat',
Failover attempt was aborted.::SQLSTATE: XRE04Connection lost for replicated database 'null'.
	at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:96)
	at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:358)
	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_Local_StateTest_part1_3._testPostStartedMasterAndSlave_Failover(ReplicationRun_Local_StateTest_part1_3.java:171)
	... 23 more

Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error: SQLCODE: -1, SQLSTATE:
XRE21, SQLERRMC: Error occurred while performing failover for database '/export/home/dag/java/sb/tests/derby-3417-replicationTests.ReplicationRun_Local_StateTest_part1_3-sb.sb4.classes-1.6.0_13-14549/db_master/wombat',
Failover attempt was aborted.::SQLSTATE: XRE04Connection lost for replicated database 'null'.
	at org.apache.derby.client.am.Connection.completeSqlca(Connection.java:2082)
	at org.apache.derby.client.net.NetConnectionReply.parseRdbAccessFailed(NetConnectionReply.java:540)
	at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(NetConnectionReply.java:433)
	at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(NetConnectionReply.java:297)
	at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(NetConnectionReply.java:121)
	at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(NetConnection.java:835)
	at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessRdb(NetConnection.java:759)
	at org.apache.derby.client.net.NetConnection.flowUSRIDONLconnect(NetConnection.java:592)
	at org.apache.derby.client.net.NetConnection.flowConnect(NetConnection.java:399)
	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)
	... 26 more


> slave side stop in a client server mode results in SQLState printed without proper error
message
> ------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3417
>                 URL: https://issues.apache.org/jira/browse/DERBY-3417
>             Project: Derby
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 10.4.1.3
>            Reporter: V.Narayanan
>            Assignee: Dag H. Wanvik
>         Attachments: derby-3417.diff, derby-3417.stat
>
>
> I tried a stopSlave on the slave side of the replication system and
> found the below
> ij> connect 'jdbc:derby://localhost:1528/replicationdb;stopSlave=true';
> ERROR XRE41: DERBY SQL error: SQLCODE: -1, SQLSTATE: XRE41, SQLERRMC: XRE41
> https://issues.apache.org/jira/browse/DERBY-3205 says
> ERROR XRE41: Replication operation 'failover' or 'stopSlave' failed because the connection
with the master is working. Issue the 'failover' or 'stopMaster' operation on the master database
instead.
> needs  to be printed.
> I am not sure if this is a generic case for client server replication messages.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message