Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
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
java.lang.NullPointerException
at org.apache.sentry.hdfs.HMSPaths.renameAuthzObject(HMSPaths.java:571)
at org.apache.sentry.hdfs.UpdateableAuthzPaths.applyPartialUpdate(UpdateableAuthzPaths.java:106)
at org.apache.sentry.hdfs.UpdateableAuthzPaths.updatePartial(UpdateableAuthzPaths.java:75)
at org.apache.sentry.hdfs.SentryAuthorizationInfo.processUpdates(SentryAuthorizationInfo.java:174)
at org.apache.sentry.hdfs.SentryAuthorizationInfo.update(SentryAuthorizationInfo.java:131)
at org.apache.sentry.hdfs.SentryAuthorizationInfo.run(SentryAuthorizationInfo.java:193)
Attachments
Attachments
Issue Links
- contains
-
SENTRY-1170 renameAuthzObj should be separerated out for "alter partition" and "alter table rename"
- Resolved
-
SENTRY-1180 Add test cases for HMSPaths.renameAuthzObject
- Resolved
- is related to
-
SENTRY-1181 Lock SentryAuthorizationInfo#processUpdates
- Resolved
-
SENTRY-1169 MetastorePlugin#renameAuthzObject log message prints oldpathname as newpathname
- Resolved
-
SENTRY-1182 [Failure recovery] NN should prompt a full Path update from sentry if X number of retries fail
- Open
-
SENTRY-1185 [HDFS plugin] Add test cases for all sub commands of Alter table and Alter table partition
- Open
-
SENTRY-1183 [Hive] Make sure "drop if exists" does not fire the post event hook when table does not exist
- Open
- relates to
-
SENTRY-1370 Obj,Path mapping in HMSPaths.authzObjToPath and HMSPaths.root may diverge resulting in unexpected behavior
- Resolved
- links to