hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Enis Soztutar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-17460) enable_table_replication can not perform cyclic replication of a table
Date Fri, 24 Feb 2017 00:20:45 GMT

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

Enis Soztutar commented on HBASE-17460:

Sorry to come in late. Can you please address these review comments as well. An addendum is
fine, otherwise, we need to revert again 
 - {{copyReplicationScope()}} should be private. 
 - {{copyReplicationScope()}}
 - In Java convention, the open parenthesis should be in the same line: 
 +  public int copyReplicationScope(final HTableDescriptor localHtd)
+  {
+        if (remoteHCDName.equals(localHCDName))
+        {
- copyReplicationScope() should return a boolean instead.  
- You don't check whether there are equal number of column families in the HTDs. Iterating
like this will not fail if either of them contains smaller number of column families. 
while (remoteHCDIter.hasNext() && localHCDIter.hasNext()) { 
 - The following
if (result == true) {
should be {{ if (result) }}
 - The methods compareForReplication, etc should not be in HTD. They are very replication
specific. Can we please move them to a replication-related utility class, or keep them private
in Admin. 
 - compareForReplication() should take HTD as an argument. No need to take a generic object
(unlike the generic equals() method). 

> enable_table_replication can not perform cyclic replication of a table
> ----------------------------------------------------------------------
>                 Key: HBASE-17460
>                 URL: https://issues.apache.org/jira/browse/HBASE-17460
>             Project: HBase
>          Issue Type: Bug
>          Components: Replication
>            Reporter: NITIN VERMA
>            Assignee: NITIN VERMA
>              Labels: incompatibleChange, replication
>             Fix For: 2.0.0
>         Attachments: 17460.branch-1.v3.txt, 17460.v5.txt, HBASE-17460.patch, HBASE-17460_v2.patch,
HBASE-17460_v3.patch, HBASE-17460_v4.patch
>   Original Estimate: 96h
>  Remaining Estimate: 96h
> The enable_table_replication operation is broken for cyclic replication of HBase table
as we compare all the properties of column families (including REPLICATION_SCOPE). 
> Below is exactly what happens:
> 1.  Running "enable_table_replication 'table1'  " opeartion on first cluster will set
the REPLICATION_SCOPE of all column families to peer id '1'. This will also create a table
on second cluster where REPLICATION_SCOPE is still set to peer id '0'.
> 2. Now when we run "enable_table_replication 'table1'" on second cluster, we compare
all the properties of table (including REPLICATION_SCOPE_, which obviously is different now.

> I am proposing a fix for this issue where we should avoid comparing REPLICATION_SCOPE
inside HColumnDescriotor::compareTo() method, especially when replication is not already enabled
on the desired table.
> I have made that change and it is working. I will submit the patch soon.

This message was sent by Atlassian JIRA

View raw message