ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Madhan Neethiraj <mad...@apache.org>
Subject Re: Review Request 42952: RANGER-831 : Single policy update increases policy history version by 2 - gives error to view history
Date Fri, 29 Jan 2016 16:05:05 GMT

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


Ship it!




Ship It!

- Madhan Neethiraj


On Jan. 29, 2016, 12:09 p.m., Gautam Borad wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42952/
> -----------------------------------------------------------
> 
> (Updated Jan. 29, 2016, 12:09 p.m.)
> 
> 
> Review request for ranger, Alok Lal, Don Bosco Durai, Abhay Kulkarni, Madhan Neethiraj,
Ramesh Mani, Selvamohan Neethiraj, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-831
>     https://issues.apache.org/jira/browse/RANGER-831
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement**
> When we update the object of policy ( i.e. when resource and policy item both are changed
in single update), it increments value of version field by 2 rather than incrementing it by
1. So the version in DB looks like this 1 2 4 6 8 10 .. etc
> This affects the Access Audit -> Policy Snapshot popup.
> 
> **Suggested Solution and analysis**
> 
> This issue was caused due to execution of a "select" statement between the updates to:
> 
> > policy.updateTime in RangerBaseModelService.populateEntity()
> > policy.resourceSignature in RangerPolicyServiceBase.mapViewToEntityBean()
> 
> The "select" call is to get ID of the service from its name given in policy.serviceName,
in RangerPolicyServiceBase.mapViewToEntityBean().
> 
> To fix this issue, I refactored RangerBaseModelService.populateEntity() to reorder the
sequence of updates in the policy object.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/service/RangerBaseModelService.java
ec358bb 
> 
> Diff: https://reviews.apache.org/r/42952/diff/
> 
> 
> Testing
> -------
> 
> Verified snapshots of Policy Update in history to get single increment and snapshots
show exact parameters which are updated.
> 
> 
> Thanks,
> 
> Gautam Borad
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message