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


Fix it, then Ship it!





security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
Line 4104 (original), 4106 (patched)
<https://reviews.apache.org/r/74568/#comment314166>

    Consider replacing #4106 - #4108 with the following:
      serviceType = 
daoMgr.getXXServiceDef().findServiceDefTypeByServiceName(policy.getService());
    
    Same for #4209 - #4211.


- Madhan Neethiraj


On Sept. 6, 2023, 6:04 a.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74568/
> -----------------------------------------------------------
> 
> (Updated Sept. 6, 2023, 6:04 a.m.)
> 
> 
> Review request for ranger, Abhishek  Kumar, bhavik patel, Dhaval Shah, 
> Dineshkumar Yadav, Kishor Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, 
> Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4382
>     https://issues.apache.org/jira/browse/RANGER-4382
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** Ranger export CSV rest API taking more than 4 hours to 
> complete the request for just 60k policies
> 
> **Proposed solution:** Ranger exportCSV REST endpoint returns RangerPolicies 
> along with Policy's service type, to populate service types additional DB 
> call to x_service and x_service_def table is made, though its possible that 
> initially fetched RangerPolicy objects may already have serviceType which can 
> be utilized if its available rather making the db call directly.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java 
> 036dbfec6 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> 86959423c 
> 
> 
> Diff: https://reviews.apache.org/r/74568/diff/2/
> 
> 
> Testing
> -------
> 
> Curl request without patch with 64k policies took 4 hours:
>  
>     curl -ivk -u admin:Admin123 -o /tmp/exportcsv.csv  -X GET 
> 'http://localhost:6180/service/plugins/policies/csv'
>     
> Built ranger with attached patch and reinstalled using previous DB settings :
> 
> Curl request with the proposed patch with 64k policies took 15 seconds in the 
> first attempt and 10 seconds in the second attempt.
>  
>     curl -ivk -u admin:Admin123 -o /tmp/exportcsv.csv  -X GET 
> 'http://localhost:6180/service/plugins/policies/csv'
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>

Reply via email to