You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2017/06/01 23:44:14 UTC

[2/2] hbase git commit: HBASE-18111 Replication stuck when cluster connection is closed

HBASE-18111 Replication stuck when cluster connection is closed

Conflicts:
	hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java

Signed-off-by: Andrew Purtell <ap...@apache.org>


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

Branch: refs/heads/branch-1
Commit: b66a478e73b59e0335de89038475409d916ea164
Parents: 46ee6e0
Author: Guanghao Zhang <zg...@apache.org>
Authored: Thu May 25 09:51:40 2017 +0800
Committer: Andrew Purtell <ap...@apache.org>
Committed: Thu Jun 1 15:18:04 2017 -0700

----------------------------------------------------------------------
 .../HBaseInterClusterReplicationEndpoint.java        | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b66a478e/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java
index 85bd11a..cf85ffd 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java
@@ -225,6 +225,18 @@ public class HBaseInterClusterReplicationEndpoint extends HBaseReplicationEndpoi
     return entryLists;
   }
 
+  private void reconnectToPeerCluster() {
+    HConnection connection = null;
+    try {
+      connection = HConnectionManager.createConnection(this.conf);
+    } catch (IOException ioe) {
+      LOG.warn("Failed to create connection for peer cluster", ioe);
+    }
+    if (connection != null) {
+      this.conn = connection;
+    }
+  }
+
   /**
    * Do the shipping logic
    */
@@ -256,6 +268,9 @@ public class HBaseInterClusterReplicationEndpoint extends HBaseReplicationEndpoi
         }
         continue;
       }
+      if (this.conn == null || this.conn.isClosed()) {
+        reconnectToPeerCluster();
+      }
       try {
         int futures = 0;
         for (int i=0; i<batches.size(); i++) {