HBASE-18111 Replication stuck when cluster connection is closed
Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
parent
e1f3c89b3b
commit
549171465d
|
@ -225,6 +225,18 @@ public class HBaseInterClusterReplicationEndpoint extends HBaseReplicationEndpoi
|
||||||
return entryLists;
|
return entryLists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void reconnectToPeerCluster() {
|
||||||
|
ClusterConnection connection = null;
|
||||||
|
try {
|
||||||
|
connection = (ClusterConnection) ConnectionFactory.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
|
* Do the shipping logic
|
||||||
*/
|
*/
|
||||||
|
@ -256,6 +268,9 @@ public class HBaseInterClusterReplicationEndpoint extends HBaseReplicationEndpoi
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (this.conn == null || this.conn.isClosed()) {
|
||||||
|
reconnectToPeerCluster();
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
int futures = 0;
|
int futures = 0;
|
||||||
for (int i=0; i<batches.size(); i++) {
|
for (int i=0; i<batches.size(); i++) {
|
||||||
|
|
Loading…
Reference in New Issue