You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Pradeep Agrawal <pr...@gmail.com> on 2021/07/14 13:15:44 UTC

Review Request 73460: RANGER-3341: External user's role creation may fail in certain version of MariaDB

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

Review request for ranger, Dhaval Shah, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, Vishal Suvagia, and Velmurugan Periasamy.


Bugs: RANGER-3341
    https://issues.apache.org/jira/browse/RANGER-3341


Repository: ranger


Description
-------

**Problem Statement:** During policy import on maria DB flavor it was observed that when policy user is created, return object of XXPortalUser does not have the generated unique id of the user, hence null value was assigned. null user id can't be used for entries in x_portal_user_role table for the same user. 


**Proposed Solution:** once a XXPortalUser entry is created, a fresh call need to made to fetch the same user details and if it has the generated unique id then that id can be used for creating the roles of the same user.


Diffs
-----

  security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java 318c4ee0f 


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


Testing
-------

Tested the patch in MariaDB(10.3) and postgres DB(10.15) and issue is not reproducible.


Thanks,

Pradeep Agrawal


Re: Review Request 73460: RANGER-3341: External user's role creation may fail in certain version of MariaDB

Posted by Mehul Parikh <xs...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73460/#review223238
-----------------------------------------------------------


Ship it!




Ship It!

- Mehul Parikh


On July 15, 2021, 5:51 p.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73460/
> -----------------------------------------------------------
> 
> (Updated July 15, 2021, 5:51 p.m.)
> 
> 
> Review request for ranger, Dhaval Shah, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, Vishal Suvagia, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-3341
>     https://issues.apache.org/jira/browse/RANGER-3341
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** During policy import on maria DB flavor it was observed that when policy user is created, return object of XXPortalUser does not have the generated unique id of the user, hence null value was assigned. null user id can't be used for entries in x_portal_user_role table for the same user. 
> 
> 
> **Proposed Solution:** once a XXPortalUser entry is created, a fresh call need to made to fetch the same user details and if it has the generated unique id then that id can be used for creating the roles of the same user.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/RoleDBStore.java 6483bbe1d 
>   security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java 318c4ee0f 
>   security-admin/src/main/java/org/apache/ranger/service/XGroupService.java 24cb43e54 
>   security-admin/src/test/java/org/apache/ranger/biz/TestUserMgr.java 202a113d8 
> 
> 
> Diff: https://reviews.apache.org/r/73460/diff/3/
> 
> 
> Testing
> -------
> 
> Tested the patch in MariaDB(10.3) and postgres DB(10.15) and issue is not reproducible.
> 
> 
> Note: Kafka test cases failing with and without patch in my env. need to recheck in other env.
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>


Re: Review Request 73460: RANGER-3341: External user's role creation may fail in certain version of MariaDB

Posted by Pradeep Agrawal <pr...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73460/
-----------------------------------------------------------

(Updated July 15, 2021, 5:51 p.m.)


Review request for ranger, Dhaval Shah, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, Vishal Suvagia, and Velmurugan Periasamy.


Changes
-------

Updated testcases.


Bugs: RANGER-3341
    https://issues.apache.org/jira/browse/RANGER-3341


Repository: ranger


Description
-------

**Problem Statement:** During policy import on maria DB flavor it was observed that when policy user is created, return object of XXPortalUser does not have the generated unique id of the user, hence null value was assigned. null user id can't be used for entries in x_portal_user_role table for the same user. 


**Proposed Solution:** once a XXPortalUser entry is created, a fresh call need to made to fetch the same user details and if it has the generated unique id then that id can be used for creating the roles of the same user.


Diffs (updated)
-----

  security-admin/src/main/java/org/apache/ranger/biz/RoleDBStore.java 6483bbe1d 
  security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java 318c4ee0f 
  security-admin/src/main/java/org/apache/ranger/service/XGroupService.java 24cb43e54 
  security-admin/src/test/java/org/apache/ranger/biz/TestUserMgr.java 202a113d8 


Diff: https://reviews.apache.org/r/73460/diff/3/

Changes: https://reviews.apache.org/r/73460/diff/2-3/


Testing (updated)
-------

Tested the patch in MariaDB(10.3) and postgres DB(10.15) and issue is not reproducible.


Note: Kafka test cases failing with and without patch in my env. need to recheck in other env.


Thanks,

Pradeep Agrawal