db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ole Solberg (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4186) After failover, test fails when it succeeds in connecting early to failed over slave
Date Mon, 27 Apr 2009 13:50:30 GMT

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

Ole Solberg commented on DERBY-4186:
------------------------------------

I had a look at this test again, and see that the comment on the stop master command is missing
a NOT!
This of course creates confusion in understanding how the test should behave.

       assertException(
            _stopMaster(masterServerHost, masterServerPort,
                masterDatabasePath + FS + masterDbSubPath + FS + replicatedDb),
            null); // Implies failover. // OK to continue.
The correct is that stop master does NOT imply a failover. 
But the stop master  implies a stop slave to the slave, 
which then should allow connections to both the master and the slave db!

The test should therefore be:
1. stop master should succeed. - OK
2. wait for connection on the master. - OK
3. wait for connection on the slave. - FAILS
   This currently fails with CANNOT_CONNECT_TO_DB_IN_SLAVE_MODE
   which is incorrect!
   This is possibly the same error as DERBY-3617 - Failover on slave hangs
   after stopmaster on master.
4. failover on master should fail with REPLICATION_NOT_IN_MASTER_MODE - failover has already
been done. - OK
5. wait for connection on the slave.(Currently fails as in 3.!) - FAILS


>From the spec:

https://issues.apache.org/jira/secure/attachment/12377517/replication_funcspec_v10.html

--------------------------------------------------------------------------------
Stop master:
=========
Sends a stop slave message to the slave if the network connection is working. 
Then shuts down all replication related functionality without shutting down the database.

Stop slave:
========
All transaction log that has been received from the master is written to disk. 
The slave replication functionality and the database is then shut down. 
--------------------------------------------------------------------------------

After stop master it should be possible to connect to the slave db!
Currently we get CANNOT_CONNECT_TO_DB_IN_SLAVE_MODE!


> After failover, test fails when it succeeds in connecting early to failed over slave
> ------------------------------------------------------------------------------------
>
>                 Key: DERBY-4186
>                 URL: https://issues.apache.org/jira/browse/DERBY-4186
>             Project: Derby
>          Issue Type: Bug
>          Components: Replication, Test
>    Affects Versions: 10.6.0.0
>            Reporter: Dag H. Wanvik
>
> Occasionally I see this error in ReplicationRun_Local_3_p3:
> 1) testReplication_Local_3_p3_StateNegativeTests(org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_3_p3)junit.framework.AssertionFailedError:
Expected SQLState'08004', but got connection!
> 	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.waitForSQLState(ReplicationRun.java:332)
> 	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_3_p3.testReplication_Local_3_p3_StateNegativeTests(ReplicationRun_Local_3_p3.java:170)
> 	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)
> In the code, after a stopMaster is given to the master (should lead to fail-over),
> the tests expects to see CANNOT_CONNECT_TO_DB_IN_SLAVE_MODE (08004.C.7), which will only
succeed if
> the tests gets to try to connect before the failover has started. This seems wrong. If
the failover has completed, it should expect a successful
> connect (which boots the database, btw, since its shut down after auccessful failover).
> Quote from code:
> waitForSQLState("08004", 100L, 20, // 08004.C.7 - CANNOT_CONNECT_TO_DB_IN_SLAVE_MODE
>                 slaveDatabasePath + FS + slaveDbSubPath + FS + replicatedDb,
>                 slaveServerHost, slaveServerPort); // _failOver above fails...
> There is a race between the failover on the slave and the test here I think.

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