Skip to content

Commit

Permalink
HBASE-27105 HBaseInterClusterReplicationEndpoint should honor replica…
Browse files Browse the repository at this point in the history
…tion adaptive timeout (#4515)

Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
  • Loading branch information
pankaj72981 authored Jun 23, 2022
1 parent 9bae50f commit 342183e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@
import org.apache.hadoop.hbase.client.AsyncRegionServerAdmin;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.ipc.CallTimeoutException;
import org.apache.hadoop.hbase.ipc.RpcServer;
import org.apache.hadoop.hbase.protobuf.ReplicationProtobufUtil;
import org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException;
import org.apache.hadoop.hbase.regionserver.wal.WALUtil;
import org.apache.hadoop.hbase.replication.HBaseReplicationEndpoint;
import org.apache.hadoop.hbase.replication.ReplicationUtils;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.CommonFSUtils;
import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
Expand Down Expand Up @@ -425,6 +427,7 @@ private long parallelReplicate(ReplicateContext replicateContext, List<List<Entr
@Override
public boolean replicate(ReplicateContext replicateContext) {
int sleepMultiplier = 1;
int initialTimeout = replicateContext.getTimeout();

if (!peersSelected && this.isRunning()) {
connectToPeers();
Expand Down Expand Up @@ -492,6 +495,9 @@ public boolean replicate(ReplicateContext replicateContext) {
} else if (ioe instanceof ConnectException || ioe instanceof UnknownHostException) {
LOG.warn("{} Peer is unavailable, rechecking all sinks: ", logPeerId(), ioe);
chooseSinks();
} else if (ioe instanceof CallTimeoutException) {
replicateContext
.setTimeout(ReplicationUtils.getAdaptiveTimeout(initialTimeout, sleepMultiplier));
} else {
LOG.warn("{} Can't replicate because of a local or network error: ", logPeerId(), ioe);
}
Expand Down

0 comments on commit 342183e

Please sign in to comment.