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

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

     [ https://issues.apache.org/jira/browse/HDDS-6640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sammi Chen resolved HDDS-6640.
------------------------------
    Resolution: Fixed

> 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
>            Priority: Major
>              Labels: pull-request-available
>
> 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