Janus Chow created HDDS-6640:
--------------------------------

             Summary: Node.isAncestor might return incorrect result
                 Key: HDDS-6640
                 URL: https://issues.apache.org/jira/browse/HDDS-6640
             Project: Apache Ozone
          Issue Type: Bug
            Reporter: Janus Chow
            Assignee: Janus Chow


In NodeImpl, the relation of ancestor is decided as follows:
{code:java}
@Override
public boolean isAncestor(Node node) {
  return this.getNetworkFullPath().equals(PATH_SEPARATOR_STR) ||
      node.getNetworkLocation().startsWith(this.getNetworkFullPath()) ||
      node.getNetworkFullPath().equalsIgnoreCase(this.getNetworkFullPath()); 
{code}
The corner case is as follows:
{code:java}
Node n1: "/rc"
Node n2: "/rc1/dc/1.1.1.1"{code}
The result of n1.isAncestor(n2) is false, while in fact n1 is not n2's ancestor.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to