From a918bf0d7b37c37e79e52b9131186a0787e8cbc6 Mon Sep 17 00:00:00 2001 From: XinSun Date: Wed, 16 Sep 2020 18:01:55 +0800 Subject: [PATCH] HBASE-25012 HBASE-24359 causes replication missed log of some RemoteException (#2384) Signed-off-by: Guanghao Zhang --- .../HBaseInterClusterReplicationEndpoint.java | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) 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 6a407e2fd1ff..816345f629d3 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 @@ -542,20 +542,26 @@ public boolean replicate(ReplicateContext replicateContext) { parallelReplicate(pool, replicateContext, batches); return true; } catch (IOException ioe) { - if (dropOnDeletedTables && isTableNotFoundException(ioe)) { - // Only filter the edits to replicate and don't change the entries in replicateContext - // as the upper layer rely on it. - batches = filterNotExistTableEdits(batches); - if (batches.isEmpty()) { - LOG.warn("After filter not exist table's edits, 0 edits to replicate, just return"); - return true; - } - } else if (dropOnDeletedColumnFamilies && isNoSuchColumnFamilyException(ioe)) { - batches = filterNotExistColumnFamilyEdits(batches); - if (batches.isEmpty()) { - LOG.warn( - "After filter not exist column family's edits, 0 edits to replicate, just return"); - return true; + if (ioe instanceof RemoteException) { + if (dropOnDeletedTables && isTableNotFoundException(ioe)) { + // Only filter the edits to replicate and don't change the entries in replicateContext + // as the upper layer rely on it. + batches = filterNotExistTableEdits(batches); + if (batches.isEmpty()) { + LOG.warn("After filter not exist table's edits, 0 edits to replicate, just return"); + return true; + } + } else if (dropOnDeletedColumnFamilies && isNoSuchColumnFamilyException(ioe)) { + batches = filterNotExistColumnFamilyEdits(batches); + if (batches.isEmpty()) { + LOG.warn("After filter not exist column family's edits, 0 edits to replicate, " + + "just return"); + return true; + } + } else { + LOG.warn("{} Peer encountered RemoteException, rechecking all sinks: ", logPeerId(), + ioe); + replicationSinkMgr.chooseSinks(); } } else { if (ioe instanceof SocketTimeoutException) {