> On Jan. 31, 2025, 5:31 p.m., Madhan Neethiraj wrote:
> > security-admin/src/main/java/org/apache/ranger/patch/cliutil/TrxLogV2MigrationUtil.java
> > Lines 120 (patched)
> > <https://reviews.apache.org/r/75350/diff/4/?file=2297524#file2297524line120>
> >
> >     #120 would return always false when table x_trx_log exists, which would 
> > result in migration to be skipped in #108. Can you make sure to validate 
> > this patch in following environments?
> >     
> >     - with x_trx_log table having some entries
> >     - with x_trx_log table having no entries
> >     - without x_trx_log table

When the x_trx_log table exists, the SQL query returns one row with a single 
value (0) because COUNT(*) always produces a result. As a result, 
getResultList() returns a list with one element (e.g., [0]), causing isEmpty() 
to return false.

This behavior has been successfully validated in all scenarios:
With x_trx_log table having some entries
With x_trx_log table having no entries
Without x_trx_log table


- Rakesh


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


On Jan. 31, 2025, 7:08 a.m., Rakesh Gupta wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/75350/
> -----------------------------------------------------------
> 
> (Updated Jan. 31, 2025, 7:08 a.m.)
> 
> 
> Review request for ranger, Dineshkumar Yadav, Kishor Gollapalliwar, Abhay 
> Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, Ramesh Mani, 
> sanket shelar, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-5123
>     https://issues.apache.org/jira/browse/RANGER-5123
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Fix the transaction log migration failure when executing 
> ranger-admin-transaction-log-migrate.sh on a fresh setup by checking for the 
> existence of the x_trx_log table before execution, ensuring a successful 
> migration.
> 
> 
> Diffs
> -----
> 
>   distro/src/main/assembly/admin-web.xml 748632809 
>   embeddedwebserver/scripts/ranger-admin-transaction-log-migrate.sh  
>   
> security-admin/src/main/java/org/apache/ranger/patch/cliutil/TrxLogV2MigrationUtil.java
>  bb8ba0b0b 
> 
> 
> Diff: https://reviews.apache.org/r/75350/diff/4/
> 
> 
> Testing
> -------
> 
> The ranger-admin-transaction-log-migrate.sh script has been tested and 
> verified to check for the x_trx_log table's existence, handling both missing 
> and existing tables without failure, ensuring successful migration.
> 
> 
> Thanks,
> 
> Rakesh Gupta
> 
>

Reply via email to