Re: Review Request 73719: RANGER-3435: Add unique index on guid, service and zone_id column of x_policy table

2021-12-02 Thread Kishor Gollapalliwar

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


Ship it!




Ship It!

- Kishor Gollapalliwar


On Nov. 24, 2021, 3:44 p.m., Pradeep Agrawal wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73719/
> ---
> 
> (Updated Nov. 24, 2021, 3:44 p.m.)
> 
> 
> Review request for ranger, Dineshkumar Yadav, Abhay Kulkarni, Madhan 
> Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan 
> Periasamy.
> 
> 
> Bugs: RANGER-3435
> https://issues.apache.org/jira/browse/RANGER-3435
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> **Problem Statement:** After first commit of RANGER-3435 
> https://reviews.apache.org/r/73594/  x_policy table have unique constraint on 
> guid and service column. if there are more than one zone and policies 
> exported from one zone is imported in the other zone then policy guid will 
> remain same. since guid are same for both the policies, we need to restrict 1 
> entry only for the same guid under a specific service and zone.
> 
> **Proposed Solution:**
> it will be better to include zone_id also with guid and service column for 
> the unique key creation so that the same restriction can be enforced from db 
> end.
> 
> 
> Diffs
> -
> 
>   security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 
> e444e78eb 
>   
> security-admin/db/mysql/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
>  357b7efe3 
>   security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 
> 9e5da70fc 
>   
> security-admin/db/oracle/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
>  580841c6b 
>   security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql 
> 9fd45037b 
>   
> security-admin/db/postgres/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
>  81718aae4 
>   
> security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
>  bdccecc19 
>   
> security-admin/db/sqlanywhere/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
>  16ad476e4 
>   security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql 
> 8515ac0b0 
>   
> security-admin/db/sqlserver/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
>  3037988e2 
> 
> 
> Diff: https://reviews.apache.org/r/73719/diff/3/
> 
> 
> Testing
> ---
> 
> Tested the patch for MySQL, Oracle, Postgres and MSSQL.
> unique constraint is being created in x_policy table for a fresh installation 
> and upgrade case as well.
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>



Re: Review Request 73719: RANGER-3435: Add unique index on guid, service and zone_id column of x_policy table

2021-12-01 Thread Mehul Parikh

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


Ship it!




Ship It!

- Mehul Parikh


On Nov. 24, 2021, 3:44 p.m., Pradeep Agrawal wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73719/
> ---
> 
> (Updated Nov. 24, 2021, 3:44 p.m.)
> 
> 
> Review request for ranger, Dineshkumar Yadav, Abhay Kulkarni, Madhan 
> Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan 
> Periasamy.
> 
> 
> Bugs: RANGER-3435
> https://issues.apache.org/jira/browse/RANGER-3435
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> **Problem Statement:** After first commit of RANGER-3435 
> https://reviews.apache.org/r/73594/  x_policy table have unique constraint on 
> guid and service column. if there are more than one zone and policies 
> exported from one zone is imported in the other zone then policy guid will 
> remain same. since guid are same for both the policies, we need to restrict 1 
> entry only for the same guid under a specific service and zone.
> 
> **Proposed Solution:**
> it will be better to include zone_id also with guid and service column for 
> the unique key creation so that the same restriction can be enforced from db 
> end.
> 
> 
> Diffs
> -
> 
>   security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 
> e444e78eb 
>   
> security-admin/db/mysql/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
>  357b7efe3 
>   security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 
> 9e5da70fc 
>   
> security-admin/db/oracle/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
>  580841c6b 
>   security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql 
> 9fd45037b 
>   
> security-admin/db/postgres/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
>  81718aae4 
>   
> security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
>  bdccecc19 
>   
> security-admin/db/sqlanywhere/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
>  16ad476e4 
>   security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql 
> 8515ac0b0 
>   
> security-admin/db/sqlserver/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
>  3037988e2 
> 
> 
> Diff: https://reviews.apache.org/r/73719/diff/3/
> 
> 
> Testing
> ---
> 
> Tested the patch for MySQL, Oracle, Postgres and MSSQL.
> unique constraint is being created in x_policy table for a fresh installation 
> and upgrade case as well.
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>



Re: Review Request 73719: RANGER-3435: Add unique index on guid, service and zone_id column of x_policy table

2021-11-24 Thread Pradeep Agrawal

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

(Updated Nov. 24, 2021, 3:44 p.m.)


Review request for ranger, Dineshkumar Yadav, Abhay Kulkarni, Madhan Neethiraj, 
Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.


Changes
---

rebased the patch


Bugs: RANGER-3435
https://issues.apache.org/jira/browse/RANGER-3435


Repository: ranger


Description
---

**Problem Statement:** After first commit of RANGER-3435 
https://reviews.apache.org/r/73594/  x_policy table have unique constraint on 
guid and service column. if there are more than one zone and policies exported 
from one zone is imported in the other zone then policy guid will remain same. 
since guid are same for both the policies, we need to restrict 1 entry only for 
the same guid under a specific service and zone.

**Proposed Solution:**
it will be better to include zone_id also with guid and service column for the 
unique key creation so that the same restriction can be enforced from db end.


Diffs (updated)
-

  security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql e444e78eb 
  
security-admin/db/mysql/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
 357b7efe3 
  security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 
9e5da70fc 
  
security-admin/db/oracle/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
 580841c6b 
  security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql 
9fd45037b 
  
security-admin/db/postgres/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
 81718aae4 
  
security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql 
bdccecc19 
  
security-admin/db/sqlanywhere/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
 16ad476e4 
  security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql 
8515ac0b0 
  
security-admin/db/sqlserver/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
 3037988e2 


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

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


Testing
---

Tested the patch for MySQL, Oracle, Postgres and MSSQL.
unique constraint is being created in x_policy table for a fresh installation 
and upgrade case as well.


Thanks,

Pradeep Agrawal



Review Request 73719: RANGER-3435: Add unique index on guid, service and zone_id column of x_policy table

2021-11-22 Thread Pradeep Agrawal

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

Review request for ranger, Dineshkumar Yadav, Abhay Kulkarni, Madhan Neethiraj, 
Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.


Bugs: RANGER-3435
https://issues.apache.org/jira/browse/RANGER-3435


Repository: ranger


Description
---

**Problem Statement:** After first commit of RANGER-3435 
https://reviews.apache.org/r/73594/  x_policy table have unique constraint on 
guid and service column. if there are more than one zone and policies exported 
from one zone is imported in the other zone then policy guid will remain same. 
since guid are same for both the policies, we need to restrict 1 entry only for 
the same guid under a specific service and zone.

**Proposed Solution:**
it will be better to include zone_id also with guid and service column for the 
unique key creation so that the same restriction can be enforced from db end.


Diffs
-

  security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 9e2892a1c 
  
security-admin/db/mysql/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
 357b7efe3 
  security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 
65f9ad2f6 
  
security-admin/db/oracle/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
 580841c6b 
  security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql 
a5bcf488b 
  
security-admin/db/postgres/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
 81718aae4 
  
security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql 
a48f2348c 
  
security-admin/db/sqlanywhere/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
 16ad476e4 
  security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql 
5cbe6d5a7 
  
security-admin/db/sqlserver/patches/057-add-unique-constraint-on-x_policy-table-guid-service-column.sql
 3037988e2 


Diff: https://reviews.apache.org/r/73719/diff/1/


Testing
---

Tested the patch for MySQL, Oracle, Postgres and MSSQL.
unique constraint is being created in x_policy table for a fresh installation 
and upgrade case as well.


Thanks,

Pradeep Agrawal