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

V.Narayanan commented on DERBY-3254:
------------------------------------

Before starting to make the patch there are a few things I thought I should 
detail out

I had earlier decided on the following set of steps to implement failover

* The failover command is given to the master.
* The master flushes the log buffer
* The master sends this command to the slave and waits for a response
* The slave responds with an acknowledgement
* The master stops replication

There are a few refinements to these steps that would become necessary because 
of the
following issues

1) When the master stops replication is it necessary for it to shutdown the 
database?

I believe the answer is YES because there is no point in having the master 
serving clients 
when the slave is doing likewise for the same database. Having two databases 
serving clients
would create trouble for the users.

2) In the aforementioned steps there is a window between the stop master 
operation 
(not shutting down database), sending a failover command to the slave, not 
succeeding, 
restarting master operation.

Stopping master, flushes the log buffer, and stops the log buffer from 
buffering more records.

But this does not stop the clients being served. So the next time you start 
replication you 
would be inconsistent. 

Therefore we would need to stop clients in some way before flushing the log 
buffer.

The above two issues lead to the following refinements in the steps mentioned 
earlier

* The failover command is given to the master
* We stop the clients upon receiving this command
* The master Flushes the log buffer
* The master sends the failover command to the slave and waits for
a response
* The slave responds with a acknowledgement
* The master stops replication and shuts down the database.

In the event of a failure the master would resume serving clients.

> Implement the replication failover functionality
> ------------------------------------------------
>
>                 Key: DERBY-3254
>                 URL: https://issues.apache.org/jira/browse/DERBY-3254
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Replication
>            Reporter: V.Narayanan
>            Assignee: V.Narayanan
>         Attachments: failover_impl_notforcommit.diff, 
> failover_impl_notforcommit.stat, failover_impl_v1.diff, failover_impl_v1.stat
>
>


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