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...@freestoneinfotech.com> on 2016/06/20 10:00:50 UTC

Review Request 48944: RANGER-1041 : Failure to add/update one user should not cause failure in syncing rest of the users

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

Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Selvamohan Neethiraj, and Velmurugan Periasamy.


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


Repository: ranger


Description
-------

**Problem Statement:** Failure to add/update one user causes failure in syncing rest of the users.
Currently from UserSync module REST API call is made to sync users to Ranger Admin. Since User syncing happens sequentially using for loop; failure of any request may stop syncing of rest of the users.

**Proposed Solution:** 
Code block which is responsible for syncing of users to Ranger admin should be surrounded within try/catch block.


Diffs
-----

  security-admin/src/main/java/org/apache/ranger/biz/SessionMgr.java 6fcf754 
  security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java ca27580 
  security-admin/src/main/java/org/apache/ranger/solr/SolrAccessAuditsService.java 0d6eefa 
  ugsync/src/main/java/org/apache/ranger/unixusersync/process/FileSourceUserGroupBuilder.java 54e47f6 
  ugsync/src/main/java/org/apache/ranger/unixusersync/process/PolicyMgrUserGroupBuilder.java df029c2 
  ugsync/src/main/java/org/apache/ranger/unixusersync/process/UnixUserGroupBuilder.java 12e6a93 
  ugsync/src/main/java/org/apache/ranger/usergroupsync/UserGroupSync.java 9d20aaa 

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


Testing
-------

**Steps performed(without patch to reproduce the case) :**
1. Installed and started Ranger admin and Ranger user sync.
2. After Ranger user sync finished user syncing; picked an existing user 'hive' and manually executed insert statement to create duplicate entry of the user in x_user table.
3. Restarted user sync and created OS user 'ranger1' and 'ranger2' to sync them in Ranger admin.
4. Syncing of users 'ranger1' and 'ranger2' did not happened as syncing process stop when it started processing user 'hive'.

**Steps performed(with patch) :**
1. Provided without patch configuration of Ranger admin and Ranger usersync in install.properties file.
2. Installed and started Ranger admin and Ranger user sync. 
3. Opened Ranger usersync log in terminal to track the failure message(if any).
4. Logged into Ranger Admin UI and visited User/groups page.

**Expected Behavior :** User 'ranger1' and 'ranger2' should get synced in Ranger admin and appear in UI. There should not be any usersync failure log in Ranger usersync log file(usersync.log)

**Actual Behavior :** User 'ranger1' and 'ranger2' were synced in Ranger admin and was appearing at Ranger users page. Failure log messages related to syncing of users were not coming in usersync.log file.


Thanks,

Pradeep Agrawal


Re: Review Request 48944: RANGER-1041 : Failure to add/update one user should not cause failure in syncing rest of the users

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




security-admin/src/main/java/org/apache/ranger/biz/SessionMgr.java (line 206)
<https://reviews.apache.org/r/48944/#comment203768>

    Changes to create knoxsso authenticated user if doesn't exist at Ranger admin end.



security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java (line 1861)
<https://reviews.apache.org/r/48944/#comment203771>

    Try catch block to handle runtime exceptions during user creation



security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java (line 1879)
<https://reviews.apache.org/r/48944/#comment203772>

    double check if reload user data from db if user creation fails and/or user already exist in db.



security-admin/src/main/java/org/apache/ranger/solr/SolrAccessAuditsService.java (line 170)
<https://reviews.apache.org/r/48944/#comment203775>

    Log only if debug mode is enabled


- Pradeep Agrawal


On June 20, 2016, 10 a.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48944/
> -----------------------------------------------------------
> 
> (Updated June 20, 2016, 10 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Selvamohan Neethiraj, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-1041
>     https://issues.apache.org/jira/browse/RANGER-1041
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** Failure to add/update one user causes failure in syncing rest of the users.
> Currently from UserSync module REST API call is made to sync users to Ranger Admin. Since User syncing happens sequentially using for loop; failure of any request may stop syncing of rest of the users.
> 
> **Proposed Solution:** 
> Code block which is responsible for syncing of users to Ranger admin should be surrounded within try/catch block.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/SessionMgr.java 6fcf754 
>   security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java ca27580 
>   security-admin/src/main/java/org/apache/ranger/solr/SolrAccessAuditsService.java 0d6eefa 
>   ugsync/src/main/java/org/apache/ranger/unixusersync/process/FileSourceUserGroupBuilder.java 54e47f6 
>   ugsync/src/main/java/org/apache/ranger/unixusersync/process/PolicyMgrUserGroupBuilder.java df029c2 
>   ugsync/src/main/java/org/apache/ranger/unixusersync/process/UnixUserGroupBuilder.java 12e6a93 
>   ugsync/src/main/java/org/apache/ranger/usergroupsync/UserGroupSync.java 9d20aaa 
> 
> Diff: https://reviews.apache.org/r/48944/diff/
> 
> 
> Testing
> -------
> 
> **Steps performed(without patch to reproduce the case) :**
> 1. Installed and started Ranger admin and Ranger user sync.
> 2. After Ranger user sync finished user syncing; picked an existing user 'hive' and manually executed insert statement to create duplicate entry of the user in x_user table.
> 3. Restarted user sync and created OS user 'ranger1' and 'ranger2' to sync them in Ranger admin.
> 4. Syncing of users 'ranger1' and 'ranger2' did not happened as syncing process stop when it started processing user 'hive'.
> 
> **Steps performed(with patch) :**
> 1. Provided without patch configuration of Ranger admin and Ranger usersync in install.properties file.
> 2. Installed and started Ranger admin and Ranger user sync. 
> 3. Opened Ranger usersync log in terminal to track the failure message(if any).
> 4. Logged into Ranger Admin UI and visited User/groups page.
> 
> **Expected Behavior :** User 'ranger1' and 'ranger2' should get synced in Ranger admin and appear in UI. There should not be any usersync failure log in Ranger usersync log file(usersync.log)
> 
> **Actual Behavior :** User 'ranger1' and 'ranger2' were synced in Ranger admin and was appearing at Ranger users page. Failure log messages related to syncing of users were not coming in usersync.log file.
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>