HBASE-26453 Correct the behavior of isBeneath to not consider paths which share a...
authorJosh Elser <elserj@apache.org>
Fri, 12 Nov 2021 17:57:07 +0000 (12:57 -0500)
committerJosh Elser <elserj@apache.org>
Thu, 18 Nov 2021 00:56:00 +0000 (19:56 -0500)
commit0aaacf63cd784566a1f98555839e068ac6a0e8d0
tree653affa2180e75c2f268fc0b67908848847049c7
parent04a304e50c200803b6c8b8ca5ec321fd23899210
HBASE-26453 Correct the behavior of isBeneath to not consider paths which share a name prefix as beneath one another.

The current implementation of isBeneath fails when given paths of the
form '/foo' and '/foobar' (returning that '/foobar' is beneath '/foo').

Because this method returns incorrect values, it causes Curator mutexes
to be removed and znodes to be removed while they were potentially held.

Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
hbase-oss/src/main/java/org/apache/hadoop/hbase/oss/sync/ZKTreeLockManager.java
hbase-oss/src/test/java/org/apache/hadoop/hbase/oss/sync/TestZKTreeLockManager.java [new file with mode: 0644]