Fang-Yu Rao has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/24785 )

Change subject: IMPALA-15323: Produce Ranger audit events for CREATE/DROP ROLE
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/24785/5/fe/src/test/java/org/apache/impala/authorization/ranger/RangerCatalogdAuthorizationManagerTest.java
File 
fe/src/test/java/org/apache/impala/authorization/ranger/RangerCatalogdAuthorizationManagerTest.java:

http://gerrit.cloudera.org:8080/#/c/24785/5/fe/src/test/java/org/apache/impala/authorization/ranger/RangerCatalogdAuthorizationManagerTest.java@131
PS5, Line 131:     // at the beginning dropRole(), we create the test role 
'TEST_ROLE_2' as the user
Thanks Quanlong!

> createRole() doesn't need to drop the role at the end and dropRole() doesn't 
> need to create the role

Take createRole() for example, currently we run the test with the requesting 
users being 'RANGER_ADMIN' and 'OWNER_USER', respectively, and expect the call 
to authzManager.createRole() to succeed and fail, respectively. Therefore, it's 
possible that role 'TEST_ROLE_2' is not created after createRole() (when the 
requesting user is 'OWNER_USER'). In this case, we do not need to  drop the 
role in the end of createRole().

On the other hand, in addition to the case when 'RANGER_ADMIN' is able to 
create the role, I also considered the case in which the requesting 
'OWNER_USER' is able to create the role 'TEST_ROLE_2', although this user is 
not supposed to be able to create the role. In both scenarios, we need to drop 
the role in the end of createRole() so that we don't have leftover roles.

I guess I wanted to say in theory it's possible that we could have an unwanted 
leftover role when we do not expect the requesting user to be able to create 
the role. That's one of the reasons I added the logic at the end of 
createRole() to make sure we don't have leftover roles.

Am I overthinking? I guess I could simplify the tests somehow (e.g., by not 
dropping the role at the end of createRole() and adjusting how we call 
dropRole() accordingly) if they look overly complicated. But in this case, 
there could be unwanted leftover roles after the test as pointed out above when 
there are regressions in Apache/CDP Ranger.



--
To view, visit http://gerrit.cloudera.org:8080/24785
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3fcfe0dcf54041aca57ed66ddef95b0ddd15b6fb
Gerrit-Change-Number: 24785
Gerrit-PatchSet: 5
Gerrit-Owner: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Jason Fehr <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Comment-Date: Wed, 28 Oct 2026 21:40:32 +0000
Gerrit-HasComments: Yes

Reply via email to