-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67899/
-----------------------------------------------------------

(Updated July 13, 2018, 3:45 p.m.)


Review request for sentry, Arjun Mishra, kalyan kumar kalvagadda, and Sergio 
Pena.


Bugs: sentry-2299
    https://issues.apache.org/jira/browse/sentry-2299


Repository: sentry


Description (updated)
-------

Sentry client at NameNode does not create entry for a table whose location is 
not with in the sentry managed prefix's . When user rename this table with 
different path, null exception happens. The fix is to check if old entry exists 
or not. If exists, move old paths to new table. Otherwise, skip that step.

You can see that in the following function createAuthzObjPath in HMSPaths.java, 
if the path is outside of prefix, no entry is created

    public Entry createAuthzObjPath(List<String> pathElements, String authzObj) 
{
      Entry entry = null;
      Entry prefix = findPrefixEntry(pathElements);
      if (prefix != null) {
        // we only create the entry if is under a prefix, else we ignore it
        entry = createChild(pathElements, EntryType.AUTHZ_OBJECT, authzObj);
      } else {
        if (LOG.isDebugEnabled()) {
          LOG.debug(String.format("%s: createAuthzObjPath(%s, %s): outside of 
prefix, skipping",        <- skip creating entry for external tables
            this, authzObj, pathElements));
        }
      }
      return entry;
    }


Diffs
-----

  
sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPaths.java
 3919d60 
  
sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestHMSPaths.java
 20ed97c 


Diff: https://reviews.apache.org/r/67899/diff/1/


Testing
-------

Add new test case for renaming external table with different paths. It passes


Thanks,

Na Li

Reply via email to