You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Dineshkumar Yadav <di...@outlook.com> on 2021/11/12 14:36:52 UTC

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

-----------------------------------------------------------
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_<DB_version>.
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_<DB_version>.
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<custom_name>_J<5 digit sequence number>.java
Proposed naming convention for dependent Java Patch. Patch<Post or Pre>Sql_<dependent DB patch version number>_<custom_name>_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


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

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
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)
<https://reviews.apache.org/r/73706/#comment312834>

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



security-admin/scripts/db_setup.py
Lines 397 (patched)
<https://reviews.apache.org/r/73706/#comment312835>

    create constant for regex.



security-admin/scripts/db_setup.py
Line 459 (original), 503 (patched)
<https://reviews.apache.org/r/73706/#comment312836>

    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_<DB_version>.
> 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_<DB_version>.
> 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<custom_name>_J<5 digit sequence number>.java
> Proposed naming convention for dependent Java Patch. Patch<Post or Pre>Sql_<dependent DB patch version number>_<custom_name>_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
> 
>


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

Posted by Pradeep Agrawal <pr...@gmail.com>.
-----------------------------------------------------------
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_<DB_version>.
> 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_<DB_version>.
> 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<custom_name>_J<5 digit sequence number>.java
> Proposed naming convention for dependent Java Patch. Patch<Post or Pre>Sql_<dependent DB patch version number>_<custom_name>_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.

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
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_<DB_version>.
> 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_<DB_version>.
> 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<custom_name>_J<5 digit sequence number>.java
> Proposed naming convention for dependent Java Patch. Patch<Post or Pre>Sql_<dependent DB patch version number>_<custom_name>_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.

Posted by Dineshkumar Yadav <di...@outlook.com>.
-----------------------------------------------------------
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.


Changes
-------

code changes


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_<DB_version>.
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_<DB_version>.
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<custom_name>_J<5 digit sequence number>.java
Proposed naming convention for dependent Java Patch. Patch<Post or Pre>Sql_<dependent DB patch version number>_<custom_name>_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 (updated)
-----

  security-admin/scripts/db_setup.py 29f074326 


Diff: https://reviews.apache.org/r/73706/diff/2/

Changes: https://reviews.apache.org/r/73706/diff/1-2/


Testing
-------

Tested in local setup for dependent pre and post java patch.


Thanks,

Dineshkumar Yadav