hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-12150) Backport replication changes from HBASE-12145
Date Fri, 03 Oct 2014 01:25:34 GMT

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

Hudson commented on HBASE-12150:
--------------------------------

FAILURE: Integrated in HBase-0.98-on-Hadoop-1.1 #535 (See [https://builds.apache.org/job/HBase-0.98-on-Hadoop-1.1/535/])
HBASE-12150 Backport replication changes from HBASE-12145 (apurtell: rev ecf09fd02b8489716383053fc5ba6ea2283fbb2c)
* hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
* hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java


> Backport replication changes from HBASE-12145
> ---------------------------------------------
>
>                 Key: HBASE-12150
>                 URL: https://issues.apache.org/jira/browse/HBASE-12150
>             Project: HBase
>          Issue Type: Task
>            Reporter: Andrew Purtell
>            Assignee: Andrew Purtell
>             Fix For: 0.98.7
>
>         Attachments: HBASE-12150.patch
>
>
> HBASE-12145 makes all zk accesses synchronized in RecoverableZooKeeper in branch-1 +:
> {code}
> @@ -690,23 +692,23 @@ public class RecoverableZooKeeper {
>      return newData;
>    }
>  
> -  public long getSessionId() {
> -    return zk == null ? null : zk.getSessionId();
> +  public synchronized long getSessionId() {
> +    return zk == null ? -1 : zk.getSessionId();
>    }
>  
> -  public void close() throws InterruptedException {
> +  public synchronized void close() throws InterruptedException {
>      if (zk != null) zk.close();
>    }
>  
> -  public States getState() {
> +  public synchronized States getState() {
>      return zk == null ? null : zk.getState();
>    }
>  
> -  public ZooKeeper getZooKeeper() {
> +  public synchronized ZooKeeper getZooKeeper() {
>      return zk;
>    }
>  
> -  public byte[] getSessionPasswd() {
> +  public synchronized byte[] getSessionPasswd() {
>      return zk == null ? null : zk.getSessionPasswd();
>    }
> {code}
> It also makes this change:
> {code}
> @@ -391,8 +390,14 @@ public class ReplicationPeersZKImpl extends ReplicationStateZKBase
implements Re
>      if (peer == null) {
>        return false;
>      }
> -    ((ConcurrentMap<String, ReplicationPeerZKImpl>) peerClusters).putIfAbsent(peerId,
peer);
> -    LOG.info("Added new peer cluster " + peer.getPeerConfig().getClusterKey());
> +    ReplicationPeerZKImpl previous =
> +      ((ConcurrentMap<String, ReplicationPeerZKImpl>) peerClusters).putIfAbsent(peerId,
peer);
> +    if (previous == null) {
> +      LOG.info("Added new peer cluster=" + peer.getPeerConfig().getClusterKey());
> +    } else {
> +      LOG.info("Peer already present, " + previous.getPeerConfig().getClusterKey() +
> +        ", new cluster=" + peer.getPeerConfig().getClusterKey());
> +    }
>      return true;
>    }
> {code}
> We should keep the 0.98 code in sync with these changes because these affect correctness.
Would like to avoid "this change works in branch-1 or master but breaks in some weird way
in 0.98" issues.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message