You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Janus Chow (Jira)" <ji...@apache.org> on 2022/04/25 03:17:00 UTC

[jira] [Created] (HDDS-6640) Node.isAncestor might return incorrect result

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: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org