[
https://issues.apache.org/jira/browse/SENTRY-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15943763#comment-15943763
]
Lei (Eddy) Xu commented on SENTRY-1644:
---------------------------------------
Sure, [~akolb]
This bug is due to that in {{HMSPath#renameAuthzObject()}}:
{code}
//new_table.add(new_path)
addPathsToAuthzObject(newName, newPathElems, true);
....
//old_table.dropAllPaths
deleteAuthzObject(oldName);
{code}
So if the old path is the directory with sub-files / sub-directories
(partitions), only the top directory was created on the new location, and thus
the sub-dirs / files are missing. So that ACLs on the partitions are missed.
This patch addressed by moving the sub-tree of the source directory entirely to
the new location.
> Partition ACLs disappear after renaming Hive table with partitions
> ------------------------------------------------------------------
>
> Key: SENTRY-1644
> URL: https://issues.apache.org/jira/browse/SENTRY-1644
> Project: Sentry
> Issue Type: Bug
> Components: Hdfs Plugin
> Affects Versions: 1.7.0, 1.8.0, sentry-ha-redesign
> Reporter: Hao Hao
> Assignee: Lei (Eddy) Xu
> Attachments: SENTRY-1644.001-sentry-ha-redesign.patch,
> SENTRY-1644.002-master.patch
>
>
> After rename Hive table with partitions, ACLs on the partition paths
> disappear.
> It can be reproducible by:
> * Create a table with partitions.
> * Rename the table.
> * The granted ACLs on the partitions disappear.
> Furthermore, in TestHMSPaths.testRenameDiffPaths add the following checking:
> {noformat}
> String partition2Path = "/user/hive/warehouse/db1.db/table2/part1";
> Assert.assertEquals(expectedSet,
> paths.findAuthzObject(HMSPaths.getPathElements(partition2Path).toArray(new
> String[0])));
> {noformat}
> It will evaluate to false, which means after rename, the path of the table
> partition disappear.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)