-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/46077/
-----------------------------------------------------------
Review request for sentry and Hao Hao.
Bugs: SENTRY-1184
https://issues.apache.org/jira/browse/SENTRY-1184
Repository: sentry
Description
-------
Currently HMSPaths.renameAuthzObject is being used for multiple cases and logic
is not being handled well causing expected behaviors to throw exceptions. This
patch makes following changes:
If oldName == newName, oldPath != newPath. This is treated as regular
newName.add(newPath), newName.delete(oldPath), so renameAuthz is not called for
this case. Example: Alter table partition rename to partition
If oldName != newName renameAuthz is called which does the following:
- If oldPath == newPath =>new_table.add(new_path),
new_table.add(old_table_partition_paths), old_table.dropAllPaths. Example:
Rename external table
- oldPath != newPath => new_table.add(new_path), old_table.dropAllPaths.
Example: Rename managed table
Also, as part of this change made updatePartial and updateFull synchronized on
UpdateableAuthzPaths object, as handling partial and full updates concurrently
can cause unexpected behavior.
Diffs
-----
sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPaths.java
ceb1da80fef393a548f2b88343b1647fdec76783
sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/UpdateableAuthzPaths.java
8fc5470088853e639e39a35fe930ca805f8ff08e
sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestHMSPaths.java
bb74779bff7c40202702f6e099fba45c47beecd3
sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java
4799d36f55308abb2c78e03e4807fa4ee8d0a79a
Diff: https://reviews.apache.org/r/46077/diff/
Testing
-------
Added new unit and e2e test cases
Thanks,
Sravya Tirukkovalur