> On Feb. 21, 2018, 7:01 p.m., kalyan kumar kalvagadda wrote:
> > I'm not sure if sentry has a test that performs a table rename and 
> > immediatly peforms an hive operation that uses the new table name. I did a 
> > quick search and did not find any.
> > If sentry doesn't have them we need to add that e2e test.
> > 
> > Somthing like this
> > **Case-1:**
> > 1. grant all on db1.tb1 to a role1.
> > 2. alter table d1.tb1 rename to d1.tb_new; //Changing the name of the table.
> > 3. perform "select * from d1.tb_new" as role1 and make sure that that 
> > authorization is granted.
> > 
> > **Case-2:**
> > 1. grant all on db1.tb1 to a role1.
> > 2. alter table d1.tb1 rename to d2.tb1; //Moving table from another 
> > database to another. 
> > 3. perform "select * from d2.tb1" as role1 and make sure that that 
> > authorization is granted.
> 
> Na Li wrote:
>     we do have such test TestDbPrivilegeCleanupOnDrop.testRenameTables. Since 
> it renames four tables at once, the delay may be long enough for it to always 
> works. I can add a test case only rename single table and access privilege of 
> old and new tables right after.

i see, i missed it. This test covers case-1 that i taked about. I have some 
comments here.
1. Previously, post event listener was not added so there was a need to add a 
delay between renaming and checking the privileges to make sure that 
notification was processed by sentry.
There is not need for below statement now. We need to remove this sleep to test 
the real scenario.
    **Thread.sleep(WAIT_FOR_NOTIFICATION_PROCESSING);**
2. Please add a test to cover case-2 as well.


- kalyan kumar


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


On Feb. 21, 2018, 4:52 p.m., Na Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65704/
> -----------------------------------------------------------
> 
> (Updated Feb. 21, 2018, 4:52 p.m.)
> 
> 
> Review request for sentry, Alexander Kolbasov, kalyan kumar kalvagadda, and 
> Sergio Pena.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> wait for HMS sync at alter table, which including table rename and changing 
> table columns
> 
> 
> Diffs
> -----
> 
>   
> sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentrySyncHMSNotificationsPostEventListener.java
>  24d7763 
>   
> sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegrationBase.java
>  4cd00e6 
> 
> 
> Diff: https://reviews.apache.org/r/65704/diff/2/
> 
> 
> Testing
> -------
> 
> unit tests succeeded
> 
> 
> Thanks,
> 
> Na Li
> 
>

Reply via email to