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




security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
Line 3954 (original), 3954 (patched)
<https://reviews.apache.org/r/74552/#comment314128>

    Wouldn't this fail for any value of recordType? Consider rewriting as:
    
      if (!"login_records".equalsIgnoreCase(recordType) &&
          !"trx_records".equalsIgnoreCase(recordType)) {
          ...
      }


- Madhan Neethiraj


On Aug. 21, 2023, 1:46 p.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74552/
> -----------------------------------------------------------
> 
> (Updated Aug. 21, 2023, 1:46 p.m.)
> 
> 
> Review request for ranger, bhavik patel, Abhay Kulkarni, Madhan Neethiraj, 
> Nikhil P, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja 
> Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4353
>     https://issues.apache.org/jira/browse/RANGER-4353
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** Currently ranger transaction entries are being stored 
> in x_trx_log table which may have lot of entries in few days. User need to 
> manually remove the entries from x_trx_log table time to time in order to 
> maintain disk space or handle disk space issues in a production env.
> 
> 
> ** Proposed Solution: **
> 
> 
> Option-1: Delete the entries during every start of ranger-admin service:
> 
> 
> This patch exposes two ranger configs 
> 1) "ranger.admin.init.purge.transaction_records" => should be set to 'true'. 
> default is false.
> 2) "ranger.admin.init.purge.transaction_records.retention.days" => which 
> accepts positive numerical values in days. 
> 
> 
> According to above configs During the start of ranger-admin x_trx_log table 
> entries older than the mentioned days shall be removed. 
> 
> 
> When "ranger.admin.init.purge.transaction_records" is set to 'true' and 
> "ranger.admin.init.purge.transaction_records.retention.days" value set to a 
> positive number this feature shall be affective.
> 
> 
> Option-2:  : User can call below mentioned REST api to delete the records. 
> User must use a credential which has admin role in the ranger to call this 
> REST API.
> 
> 
> curl -u admin:admin -H "Accept: application/json" -H "Content-Type: 
> application/json" -X DELETE 
> 'http://localhost:6080/service/public/v2/api/server/purge/records?type=trx_records&retentionDays=5'
> 
> 
> if retentionDays parameter is not provided then default value 180 shall be 
> considered.
> 
> 
> Note: The proposed implementation shall not delete entries every day as there 
> is no daemon process shall be running at the background, hence deletion of 
> entries shall be attempted only during the start of ranger.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java 
> ed1ea0376 
>   security-admin/src/main/java/org/apache/ranger/db/XXAuthSessionDao.java 
> f69b8d2bb 
>   security-admin/src/main/java/org/apache/ranger/db/XXTrxLogDao.java 
> a83e91f5b 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> d2d76733e 
>   security-admin/src/main/resources/META-INF/jpa_named_queries.xml 1e8e4e2c5 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml d6bf174e9 
> 
> 
> Diff: https://reviews.apache.org/r/74552/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>

Reply via email to