From 89754dd314df1cc5e01dd90ff4cf6e65343c9844 Mon Sep 17 00:00:00 2001 From: Xiaolin Ha Date: Tue, 15 Mar 2022 22:04:40 +0800 Subject: [PATCH] HBASE-26833 Avoid waiting to clear buffer usage of ReplicationSourceShipper when aborting the RS (#4218) Signed-off-by: Duo Zhang --- .../hbase/replication/regionserver/ReplicationSource.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java index 92f1979ecaea..a1d082e97010 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java @@ -704,9 +704,11 @@ public void terminate(String reason, Exception cause, boolean clearMetrics, worker.entryReader.interrupt(); } } - //If worker is already stopped but there was still entries batched, - //we need to clear buffer used for non processed entries - worker.clearWALEntryBatch(); + if (!server.isAborted() && !server.isStopped()) { + //If server is running and worker is already stopped but there was still entries batched, + //we need to clear buffer used for non processed entries + worker.clearWALEntryBatch(); + } } if (join) {