diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java index 4ff89857d2c..17dd8c2cdc6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java @@ -729,7 +729,7 @@ public class RestoreSnapshotHelper { throw new IllegalArgumentException("Filesystems for restore directory and HBase root directory " + "should be the same"); } - if (restoreDir.toUri().getPath().startsWith(rootDir.toUri().getPath())) { + if (restoreDir.toUri().getPath().startsWith(rootDir.toUri().getPath() +"/")) { throw new IllegalArgumentException("Restore directory cannot be a sub directory of HBase " + "root directory. RootDir: " + rootDir + ", restoreDir: " + restoreDir); }