Re: Review Request 73706: RANGER-3504 : Create framework to execute DB patch dependent on Java patch.

2021-11-16 Thread bhavik patel

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


Ship it!




Ship It!

- bhavik patel


On Nov. 16, 2021, 1:39 p.m., Dineshkumar Yadav wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73706/
> ---
> 
> (Updated Nov. 16, 2021, 1:39 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Jayendra Parab, Kishor 
> Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep 
> Agrawal, Ramesh Mani, Vishal Suvagia, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-3504
> https://issues.apache.org/jira/browse/RANGER-3504
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Problem Statement
> Currently we have two sets of patches in Ranger (DB & Java patches).
> During Ranger setup, DB patches get executed first then Java patches get 
> executed in an orderly manner based on their sequence. 
> We don't have any mechanism where we can execute Java Patch first and it's 
> dependent DB patch afterwards. 
>  
> Please find the below approach to handle such scenarios.
> Approach:
> While executing DB patches, first check if any pre java patches are present 
> by name starting with PatchPreSql_.
> If a Pre Java patch is found then execute that java patch first.
> Execute DB patch.
> Check again if there are any post java patches present by name starting with 
> PatchPostSql_.
> If Post Java patches are found, execute them.
> While naming the dependent Java patches we need to follow the below 
> convention.
> Currently we follow convention: Patch_J<5 digit sequence 
> number>.java
> Proposed naming convention for dependent Java Patch. Patch Pre>Sql___J<5 digit sequence 
> number>.java
> Use Case: 
> Suppose we have a DB patch (050-uniqueindex.sql) and there are two Java 
> patches one needs to execute before and another immediately after DB patch.
> In that scenario we should use the following convention for naming java 
> patches.
> Pre Java Patch : PatchPreSql_050_CleanData_J10050.java 
> Post Java Patch : PatchPostSql_050_UpdateData_J10051.java
> 
> 
> Diffs
> -
> 
>   security-admin/scripts/db_setup.py 29f074326 
> 
> 
> Diff: https://reviews.apache.org/r/73706/diff/2/
> 
> 
> Testing
> ---
> 
> Tested in local setup for dependent pre and post java patch.
> 
> 
> Thanks,
> 
> Dineshkumar Yadav
> 
>



Re: Review Request 73706: RANGER-3504 : Create framework to execute DB patch dependent on Java patch.

2021-11-16 Thread Pradeep Agrawal

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


Ship it!




Ship It!

- Pradeep Agrawal


On Nov. 16, 2021, 1:39 p.m., Dineshkumar Yadav wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73706/
> ---
> 
> (Updated Nov. 16, 2021, 1:39 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Jayendra Parab, Kishor 
> Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep 
> Agrawal, Ramesh Mani, Vishal Suvagia, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-3504
> https://issues.apache.org/jira/browse/RANGER-3504
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Problem Statement
> Currently we have two sets of patches in Ranger (DB & Java patches).
> During Ranger setup, DB patches get executed first then Java patches get 
> executed in an orderly manner based on their sequence. 
> We don't have any mechanism where we can execute Java Patch first and it's 
> dependent DB patch afterwards. 
>  
> Please find the below approach to handle such scenarios.
> Approach:
> While executing DB patches, first check if any pre java patches are present 
> by name starting with PatchPreSql_.
> If a Pre Java patch is found then execute that java patch first.
> Execute DB patch.
> Check again if there are any post java patches present by name starting with 
> PatchPostSql_.
> If Post Java patches are found, execute them.
> While naming the dependent Java patches we need to follow the below 
> convention.
> Currently we follow convention: Patch_J<5 digit sequence 
> number>.java
> Proposed naming convention for dependent Java Patch. Patch Pre>Sql___J<5 digit sequence 
> number>.java
> Use Case: 
> Suppose we have a DB patch (050-uniqueindex.sql) and there are two Java 
> patches one needs to execute before and another immediately after DB patch.
> In that scenario we should use the following convention for naming java 
> patches.
> Pre Java Patch : PatchPreSql_050_CleanData_J10050.java 
> Post Java Patch : PatchPostSql_050_UpdateData_J10051.java
> 
> 
> Diffs
> -
> 
>   security-admin/scripts/db_setup.py 29f074326 
> 
> 
> Diff: https://reviews.apache.org/r/73706/diff/2/
> 
> 
> Testing
> ---
> 
> Tested in local setup for dependent pre and post java patch.
> 
> 
> Thanks,
> 
> Dineshkumar Yadav
> 
>



Re: Review Request 73706: RANGER-3504 : Create framework to execute DB patch dependent on Java patch.

2021-11-15 Thread bhavik patel

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




security-admin/scripts/db_setup.py
Lines 380 (patched)


this can be removed as it is not used in the method



security-admin/scripts/db_setup.py
Lines 397 (patched)


create constant for regex.



security-admin/scripts/db_setup.py
Line 459 (original), 503 (patched)


Same as above Comment.


- bhavik patel


On Nov. 12, 2021, 2:36 p.m., Dineshkumar Yadav wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73706/
> ---
> 
> (Updated Nov. 12, 2021, 2:36 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Jayendra Parab, Kishor 
> Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Pradeep 
> Agrawal, Ramesh Mani, Vishal Suvagia, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-3504
> https://issues.apache.org/jira/browse/RANGER-3504
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Problem Statement
> Currently we have two sets of patches in Ranger (DB & Java patches).
> During Ranger setup, DB patches get executed first then Java patches get 
> executed in an orderly manner based on their sequence. 
> We don't have any mechanism where we can execute Java Patch first and it's 
> dependent DB patch afterwards. 
>  
> Please find the below approach to handle such scenarios.
> Approach:
> While executing DB patches, first check if any pre java patches are present 
> by name starting with PatchPreSql_.
> If a Pre Java patch is found then execute that java patch first.
> Execute DB patch.
> Check again if there are any post java patches present by name starting with 
> PatchPostSql_.
> If Post Java patches are found, execute them.
> While naming the dependent Java patches we need to follow the below 
> convention.
> Currently we follow convention: Patch_J<5 digit sequence 
> number>.java
> Proposed naming convention for dependent Java Patch. Patch Pre>Sql___J<5 digit sequence 
> number>.java
> Use Case: 
> Suppose we have a DB patch (050-uniqueindex.sql) and there are two Java 
> patches one needs to execute before and another immediately after DB patch.
> In that scenario we should use the following convention for naming java 
> patches.
> Pre Java Patch : PatchPreSql_050_CleanData_J10050.java 
> Post Java Patch : PatchPostSql_050_UpdateData_J10051.java
> 
> 
> Diffs
> -
> 
>   security-admin/scripts/db_setup.py 29f074326 
> 
> 
> Diff: https://reviews.apache.org/r/73706/diff/1/
> 
> 
> Testing
> ---
> 
> Tested in local setup for dependent pre and post java patch.
> 
> 
> Thanks,
> 
> Dineshkumar Yadav
> 
>