You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Ashish Singhi (JIRA)" <ji...@apache.org> on 2015/08/20 20:17:46 UTC
[jira] [Commented] (HBASE-11490) In HBase Shell set_peer_tableCFs,
if the tableCFS is null, it will be wrong
[ https://issues.apache.org/jira/browse/HBASE-11490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14705468#comment-14705468 ]
Ashish Singhi commented on HBASE-11490:
---------------------------------------
Recently I also faced this issue. It throws NPE.
{{ReplicationPeersZKImpl#addPeer}} behaves correctly as per the java doc but {{ReplicationPeersZKImpl#setPeerTableCFsConfig}} does not.
Patch lgtm. Can you add a test case to guard against regression ?
> In HBase Shell set_peer_tableCFs, if the tableCFS is null, it will be wrong
> ---------------------------------------------------------------------------
>
> Key: HBASE-11490
> URL: https://issues.apache.org/jira/browse/HBASE-11490
> Project: HBase
> Issue Type: Bug
> Components: Replication
> Affects Versions: 0.99.0
> Reporter: Qianxi Zhang
> Assignee: Qianxi Zhang
> Priority: Minor
> Attachments: HBASE_11490_trunk_v1.patch
>
>
> In HBase Shell set_peer_tableCFs, If the tableCFS is null, it will throw NPE
> # set all tables to be replicable for a peer
> hbase> set_peer_tableCFs '1', ""
> hbase> set_peer_tableCFs '1'
> ReplicationAdmin#199
> {code}
> public void setPeerTableCFs(String id, String tableCFs) throws ReplicationException {
> this.replicationPeers.setPeerTableCFsConfig(id, tableCFs);
> }
> {code}
> ReplicationPeersZKImpl#177
> {code}
> public void setPeerTableCFsConfig(String id, String tableCFsStr) throws ReplicationException {
> try {
> if (!peerExists(id)) {
> throw new IllegalArgumentException("Cannot set peer tableCFs because id=" + id
> + " does not exist.");
> }
> String tableCFsZKNode = getTableCFsNode(id);
> byte[] tableCFs = Bytes.toBytes(tableCFsStr);
> if (ZKUtil.checkExists(this.zookeeper, tableCFsZKNode) != -1) {
> ZKUtil.setData(this.zookeeper, tableCFsZKNode, tableCFs);
> } else {
> ZKUtil.createAndWatch(this.zookeeper, tableCFsZKNode, tableCFs);
> }
> LOG.info("Peer tableCFs with id= " + id + " is now " + tableCFsStr);
> } catch (KeeperException e) {
> throw new ReplicationException("Unable to change tableCFs of the peer with id=" + id, e);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)