hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [2/3] git commit: HBASE-11963 Synchronize peer cluster replication connection attempts (Maddineni Sukumar)
Date Sat, 13 Sep 2014 00:26:00 GMT
HBASE-11963 Synchronize peer cluster replication connection attempts (Maddineni Sukumar)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3ca81843
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3ca81843
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3ca81843

Branch: refs/heads/branch-1
Commit: 3ca81843456029a5ea224ae5758a85ec9a30b60c
Parents: 949156c
Author: Andrew Purtell <apurtell@apache.org>
Authored: Fri Sep 12 17:21:51 2014 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Fri Sep 12 17:21:57 2014 -0700

----------------------------------------------------------------------
 .../hbase/replication/HBaseReplicationEndpoint.java   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/3ca81843/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/HBaseReplicationEndpoint.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/HBaseReplicationEndpoint.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/HBaseReplicationEndpoint.java
index 4b9a28f..ea8498a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/HBaseReplicationEndpoint.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/HBaseReplicationEndpoint.java
@@ -93,7 +93,11 @@ public abstract class HBaseReplicationEndpoint extends BaseReplicationEndpoint
   }
 
   @Override
-  public UUID getPeerUUID() {
+  // Synchronize peer cluster connection attempts to avoid races and rate
+  // limit connections when multiple replication sources try to connect to
+  // the peer cluster. If the peer cluster is down we can get out of control
+  // over time.
+  public synchronized UUID getPeerUUID() {
     UUID peerUUID = null;
     try {
       peerUUID = ZKClusterId.getUUIDForCluster(zkw);
@@ -158,12 +162,16 @@ public abstract class HBaseReplicationEndpoint extends BaseReplicationEndpoint
    * @return list of addresses
    * @throws KeeperException
    */
-  public List<ServerName> getRegionServers() {
+  // Synchronize peer cluster connection attempts to avoid races and rate
+  // limit connections when multiple replication sources try to connect to
+  // the peer cluster. If the peer cluster is down we can get out of control
+  // over time.
+  public synchronized List<ServerName> getRegionServers() {
     try {
       setRegionServers(fetchSlavesAddresses(this.getZkw()));
     } catch (KeeperException ke) {
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Fetch salves addresses failed.", ke);
+        LOG.debug("Fetch slaves addresses failed", ke);
       }
       reconnect(ke);
     }


Mime
View raw message