Uploaded image for project: 'Sentry'
  1. Sentry
  2. SENTRY-1184

Clean up HMSPaths.renameAuthzObject

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.0
    • Component/s: None
    • Labels:
      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

        1. SENTRY-1184.6.patch
          18 kB
          Sravya Tirukkovalur
        2. SENTRY-1184.5.patch
          18 kB
          Sravya Tirukkovalur
        3. SENTRY-1184.4.patch
          17 kB
          Sravya Tirukkovalur
        4. SENTRY-1184.3.patch
          15 kB
          Sravya Tirukkovalur
        5. SENTRY-1184.2.patch
          9 kB
          Sravya Tirukkovalur
        6. SENTRY-1184.1.patch
          10 kB
          Sravya Tirukkovalur
        7. SENTRY-1184.002.patch
          1 kB
          Dapeng Sun
        8. SENTRY-1184.001-branch-1.5.1.patch
          1 kB
          Dapeng Sun

          Issue Links

            Activity

              People

              • Assignee:
                sravya Sravya Tirukkovalur
                Reporter:
                sravya Sravya Tirukkovalur
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: