From 66f16581671ded7c8471a90a7983fdcfc8d9787e Mon Sep 17 00:00:00 2001 From: Gkkkk302 <49739485+Gkkkk302@users.noreply.github.com> Date: Tue, 28 Jan 2020 23:15:25 +0530 Subject: [PATCH] HBASE-23045 currentPath may be stitched in a loop in replication source code. (#1006) Co-authored-by: Viraj Jasani Signed-off-by: Viraj Jasani --- .../hbase/replication/regionserver/ReplicationSource.java | 5 +++-- 1 file changed, 3 insertions(+), 2 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 c586142b64c..e5596becc8e 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 @@ -938,8 +938,9 @@ public class ReplicationSource extends Thread implements ReplicationSourceInterf Path p = rs.getPath(); FileStatus[] logs = fs.listStatus(p); for (FileStatus log : logs) { - p = new Path(p, log.getPath().getName()); - if (p.getName().equals(path.getName())) { + String logName = log.getPath().getName(); + if (logName.equals(path.getName())) { + p = new Path(p, log.getPath().getName()); LOG.info("Log " + p.getName() + " found at " + p); return p; }