You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sentry.apache.org by Ryan Pridgeon <rn...@cloudera.com> on 2015/08/04 19:13:02 UTC

Review Request 37086: view will not work with HDFS sync enabled.

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

Review request for sentry.


Repository: sentry


Description
-------

SENTRY-780: HDFS Plugin should not execute path callbacks for views


Diffs
-----

  sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java 4924669 
  sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java d75c578 

Diff: https://reviews.apache.org/r/37086/diff/


Testing
-------

Create, Drop, Create or Replace as Views with Sentry-Sync enabled.


Thanks,

Ryan Pridgeon


Re: Review Request 37086: view will not work with HDFS sync enabled.

Posted by Sravya Tirukkovalur <sr...@cloudera.com>.

> On Aug. 4, 2015, 5:50 p.m., Sravya Tirukkovalur wrote:
> > sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java, line 337
> > <https://reviews.apache.org/r/37086/diff/1/?file=1028784#file1028784line337>
> >
> >     What happens if either of the paths (old/new) are empty? Is that possible at all ? In either case: we should either handle it or atleast throw an error, as it might cause a nullpointer as well.

I meant atleast log an error.


- Sravya


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


On Aug. 4, 2015, 5:13 p.m., Ryan Pridgeon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37086/
> -----------------------------------------------------------
> 
> (Updated Aug. 4, 2015, 5:13 p.m.)
> 
> 
> Review request for sentry.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> SENTRY-780: HDFS Plugin should not execute path callbacks for views
> 
> 
> Diffs
> -----
> 
>   sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java 4924669 
>   sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java d75c578 
> 
> Diff: https://reviews.apache.org/r/37086/diff/
> 
> 
> Testing
> -------
> 
> Create, Drop, Create or Replace as Views with Sentry-Sync enabled.
> 
> 
> Thanks,
> 
> Ryan Pridgeon
> 
>


Re: Review Request 37086: view will not work with HDFS sync enabled.

Posted by Ryan Pridgeon <rn...@cloudera.com>.

> On Aug. 4, 2015, 5:50 p.m., Sravya Tirukkovalur wrote:
> > sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java, line 337
> > <https://reviews.apache.org/r/37086/diff/1/?file=1028784#file1028784line337>
> >
> >     What happens if either of the paths (old/new) are empty? Is that possible at all ? In either case: we should either handle it or atleast throw an error, as it might cause a nullpointer as well.
> 
> Sravya Tirukkovalur wrote:
>     I meant atleast log an error.

We can definitely hit a sitauation where we have a null oldPath or newPath. 

This is the exact sitation that causes the failure. Altering an existing VIEW results in both a null oldPath and null newPath. 

i.e Alter view v1 as select * from table1, Create or Replace view v1 as select * from table1.

Thanks for catching thise however as it is definitely not the ideal place to perfrom a Null check. 

The NPE does not actually cause an issue until we get to org.apache.commons.httpclient.util.EncodingUtil.getBytes. Everyone else handles the null gracefully. 

MetastorePlugin.renameAuthzObject => PathsUpdate.parsePath =>  URI uri = new URI(URIUtil.encodePath(path));

Instead I will move the Null check to PathsUpdate.parsePath so we may avoid this in all situation which call parse path rather than this specific one. 

Thanks!


- Ryan


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


On Aug. 4, 2015, 5:13 p.m., Ryan Pridgeon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37086/
> -----------------------------------------------------------
> 
> (Updated Aug. 4, 2015, 5:13 p.m.)
> 
> 
> Review request for sentry.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> SENTRY-780: HDFS Plugin should not execute path callbacks for views
> 
> 
> Diffs
> -----
> 
>   sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java 4924669 
>   sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java d75c578 
> 
> Diff: https://reviews.apache.org/r/37086/diff/
> 
> 
> Testing
> -------
> 
> Create, Drop, Create or Replace as Views with Sentry-Sync enabled.
> 
> 
> Thanks,
> 
> Ryan Pridgeon
> 
>


Re: Review Request 37086: view will not work with HDFS sync enabled.

Posted by Sravya Tirukkovalur <sr...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37086/#review94090
-----------------------------------------------------------



sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java (line 337)
<https://reviews.apache.org/r/37086/#comment148585>

    What happens if either of the paths (old/new) are empty? Is that possible at all ? In either case: we should either handle it or atleast throw an error, as it might cause a nullpointer as well.



sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java (line 938)
<https://reviews.apache.org/r/37086/#comment148586>

    nit: space before catch


- Sravya Tirukkovalur


On Aug. 4, 2015, 5:13 p.m., Ryan Pridgeon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37086/
> -----------------------------------------------------------
> 
> (Updated Aug. 4, 2015, 5:13 p.m.)
> 
> 
> Review request for sentry.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> SENTRY-780: HDFS Plugin should not execute path callbacks for views
> 
> 
> Diffs
> -----
> 
>   sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java 4924669 
>   sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java d75c578 
> 
> Diff: https://reviews.apache.org/r/37086/diff/
> 
> 
> Testing
> -------
> 
> Create, Drop, Create or Replace as Views with Sentry-Sync enabled.
> 
> 
> Thanks,
> 
> Ryan Pridgeon
> 
>


Re: Review Request 37086: DDL operations against view fail with Sentry Sync

Posted by Ryan Pridgeon <rn...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37086/
-----------------------------------------------------------

(Updated Aug. 4, 2015, 9:25 p.m.)


Review request for sentry.


Changes
-------

+ new Diff


Repository: sentry


Description
-------

SENTRY-780: HDFS Plugin should not execute path callbacks for views


Diffs
-----

  sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java 4924669 
  sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java d75c578 

Diff: https://reviews.apache.org/r/37086/diff/


Testing
-------

Create, Drop, Create or Replace as Views with Sentry-Sync enabled.


File Attachments (updated)
----------------

SENTRY-780.patch.1
  https://reviews.apache.org/media/uploaded/files/2015/08/04/21f0e0ca-6757-4c60-bb18-7fdbfe076a6c__SENTRY-780.patch.1


Thanks,

Ryan Pridgeon


Re: Review Request 37086: DDL operations against view fail with Sentry Sync

Posted by Ryan Pridgeon <rn...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37086/
-----------------------------------------------------------

(Updated Aug. 4, 2015, 8:06 p.m.)


Review request for sentry.


Changes
-------

More accurate summary


Summary (updated)
-----------------

DDL operations against view fail with Sentry Sync


Repository: sentry


Description
-------

SENTRY-780: HDFS Plugin should not execute path callbacks for views


Diffs
-----

  sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java 4924669 
  sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java d75c578 

Diff: https://reviews.apache.org/r/37086/diff/


Testing
-------

Create, Drop, Create or Replace as Views with Sentry-Sync enabled.


Thanks,

Ryan Pridgeon