From c44e88686084a60be7d4dd5afeabab22f7cddfd8 Mon Sep 17 00:00:00 2001 From: zhangduo Date: Sat, 24 Mar 2018 16:25:20 +0800 Subject: [PATCH] HBASE-20271 ReplicationSourceWALReader.switched should use the file name instead of the path object directly --- .../replication/regionserver/ReplicationSourceWALReader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 21548566cee..7ba347feb6c 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 @@ -174,7 +174,8 @@ class ReplicationSourceWALReader extends Thread { } protected static final boolean switched(WALEntryStream entryStream, Path path) { - return !path.equals(entryStream.getCurrentPath()); + Path newPath = entryStream.getCurrentPath(); + return newPath == null || !path.getName().equals(newPath.getName()); } protected WALEntryBatch readWALEntries(WALEntryStream entryStream)