From e251d41a25235cdf9e47bb112c463e96450278ec Mon Sep 17 00:00:00 2001 From: Janos Gub Date: Fri, 3 Mar 2017 13:44:13 +0100 Subject: [PATCH] HBASE-17460 enable_table_replication can not perform cyclic replication of a table - addendum v2 no check for replication enablement --- .../org/apache/hadoop/hbase/client/HBaseAdmin.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index c68d3bb..7729562 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -4188,21 +4188,11 @@ public class HBaseAdmin implements Admin { throw new IllegalArgumentException("Failed to get table descriptor for table " + tableName.getNameAsString() + " from peer cluster " + peerDesc.getPeerId()); } else { - // To support cyclic replication (HBASE-17460), we need to match the - // REPLICATION_SCOPE of table on both the clusters. We should do this - // only when the replication is not already enabled on local HTD (local - // table on this cluster). - // - if (localHtd.isReplicationEnabled()) { + if (!compareForReplication(peerHtd, localHtd)) { throw new IllegalArgumentException("Table " + tableName.getNameAsString() - + " has replication already enabled for at least one Column Family."); - } else { - if (!compareForReplication(peerHtd, localHtd)) { - throw new IllegalArgumentException("Table " + tableName.getNameAsString() - + " exists in peer cluster " + peerDesc.getPeerId() - + ", but the table descriptors are not same when compared with source cluster." - + " Thus can not enable the table's replication switch."); - } + + " exists in peer cluster " + peerDesc.getPeerId() + + ", but the table descriptors are not same when compared with source cluster." + + " Thus can not enable the table's replication switch."); } } } -- 2.10.1 (Apple Git-78)