[ 
https://issues.apache.org/jira/browse/HBASE-19782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16443522#comment-16443522
 ] 

Zheng Hu commented on HBASE-19782:
----------------------------------

Oh,  Looks like we can not just  reject replication request when new state is 
DOWNGRADE_ACTIVE,  because if C1 is transiting from S -> DA,  it'll work as 
following:

step.1   set new state to DA;
step.2   refresh peer on all rs;
step.3   replay remote wals ; 
step.4   reopen regions; 
step.5   clean new state to NONE, and set current state to DA; 

For step.3, we need to replay all remote WALs by replicating this wal entries 
into itself replication sink,  if reject replication request here,  then replay 
will be stuck. 

So the TestSyncReplicationActive failed. 
{code}
  @Test
  public void testActive() throws Exception {
    UTIL2.getAdmin().transitReplicationPeerSyncReplicationState(PEER_ID,
      SyncReplicationState.STANDBY);
    UTIL1.getAdmin().transitReplicationPeerSyncReplicationState(PEER_ID,
      SyncReplicationState.ACTIVE);
    UTIL1.getAdmin().disableReplicationPeer(PEER_ID);
    write(UTIL1, 0, 100);
    Thread.sleep(2000);
    // peer is disabled so no data have been replicated
    verifyNotReplicatedThroughRegion(UTIL2, 0, 100);
    UTIL2.getAdmin().transitReplicationPeerSyncReplicationState(PEER_ID,
      SyncReplicationState.DOWNGRADE_ACTIVE);
{code}

> Reject the replication request when peer is DA or A state
> ---------------------------------------------------------
>
>                 Key: HBASE-19782
>                 URL: https://issues.apache.org/jira/browse/HBASE-19782
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Replication
>            Reporter: Zheng Hu
>            Assignee: Zheng Hu
>            Priority: Major
>             Fix For: 3.0.0
>
>         Attachments: HBASE-19064-HBASE-19782.v1.patch, 
> HBASE-19064-HBASE-19782.v2.patch, HBASE-19782.HBASE-19064.v2.patch, 
> HBASE-19782.HBASE-19064.v2.patch, HBASE-19782.HBASE-19064.v3.patch, 
> HBASE-19782.HBASE-19064.v4.patch, HBASE-19782.HBASE-19064.v4.patch, 
> HBASE-19782.HBASE-19064.v4.patch, HBASE-19782.HBASE-19064.v5.patch, 
> HBASE-19782.HBASE-19064.v5.patch, HBASE-19782.HBASE-19064.v6.patch
>
>
> According to the design doc,  we'll initialize  both of the cluster state to 
> DA  after added the bidirectional  replication path.   and when a cluster in 
> DA state, it'll reject replication request.   
> so for cluster A and B in state DA,  if any received replication entry whose 
> table or namespace match the peer,    the cluster will  skip to apply into 
> its local rs.  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to