Yang Jie created HADOOP-20062:
---------------------------------
Summary: FileContext#setStoragePolicy, #unsetStoragePolicy and
#satisfyStoragePolicy pass the unresolved path to the file system
Key: HADOOP-20062
URL: https://issues.apache.org/jira/browse/HADOOP-20062
Project: Hadoop Common
Issue Type: Bug
Components: fs
Reporter: Yang Jie
These three methods qualify the path with fixRelativePart() and run it through
an FSLinkResolver, but inside {{next(fs, p)}} they call the file system with
the caller's original path instead of {{p}}. As a result:
* A relative path is not resolved against the working directory. On HDFS,
{{fc.setStoragePolicy(new Path("dir"), "COLD")}} fails with
"InvalidPathException: relative paths not allowed", while
{{fc.getStoragePolicy(new Path("dir"))}} on the same FileContext works.
* When the file system throws UnresolvedLinkException, the resolver retries
with the link path again, so the call never reaches the link target and ends
with "Possible cyclic loop while following symbolic link".
Every other FSLinkResolver in FileContext passes {{p}}, and the fix does the
same. Nothing changes for an absolute path without symlinks. HDFS-17843 is a
similar issue in DistributedFileSystem.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]