This is an automated email from the ASF dual-hosted git repository.

haxiaolin pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.5 by this push:
     new a3abc5244bd HBASE-28037 Replication stuck after switching to new WAL 
but the queue is empty (#5375)
a3abc5244bd is described below

commit a3abc5244bd04e0054060807f9bcb83c8e242f96
Author: Xiaolin Ha <haxiao...@apache.org>
AuthorDate: Thu Sep 28 09:05:03 2023 +0800

    HBASE-28037 Replication stuck after switching to new WAL but the queue is 
empty (#5375)
    
    Signed-off-by: Duo Zhang <zhang...@apache.org>
---
 .../hbase/replication/regionserver/ReplicationSourceWALReader.java   | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceWALReader.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceWALReader.java
index e6718c06829..83b3c588d52 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceWALReader.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceWALReader.java
@@ -241,9 +241,8 @@ class ReplicationSourceWALReader extends Thread {
 
   private void handleEmptyWALEntryBatch() throws InterruptedException {
     LOG.trace("Didn't read any new entries from WAL");
-    if (logQueue.getQueue(walGroupId).isEmpty()) {
-      // we're done with current queue, either this is a recovered queue, or 
it is the special group
-      // for a sync replication peer and the peer has been transited to DA or 
S state.
+    if (logQueue.getQueue(walGroupId).isEmpty() && source.isRecovered()) {
+      // we're done with current queue, which should be a recovered queue
       LOG.debug("Stopping the replication source wal reader");
       setReaderRunning(false);
       // shuts down shipper thread immediately

Reply via email to