You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by bhavik patel <bh...@gmail.com> on 2017/09/05 06:24:46 UTC

Review Request 62074: RANGER-1765 : Add unique key constraint in x_group and x_group_users table

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

Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


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


Repository: ranger


Description
-------

Currently, concurrent request to create a group or create group-users mapping is causing duplicate entries of the same group in x_group table. This need to be restricted in DB tables by creating relevant constraint on the table.


Diffs
-----

  security-admin/db/mysql/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
  security-admin/db/oracle/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
  security-admin/db/postgres/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
  security-admin/db/sqlanywhere/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
  security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql 68d3a05 
  security-admin/db/sqlserver/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 


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


Testing
-------

1. Tested Ranger Admin, Usersync, Ranger KMS with all database flavour.


Thanks,

bhavik patel


Re: Review Request 62074: RANGER-1765 : Add unique key constraint in x_group and x_group_users table

Posted by Pradeep Agrawal <pr...@freestoneinfotech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62074/#review185287
-----------------------------------------------------------


Ship it!




Ship It!

- Pradeep Agrawal


On Sept. 8, 2017, 4:14 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62074/
> -----------------------------------------------------------
> 
> (Updated Sept. 8, 2017, 4:14 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-1765
>     https://issues.apache.org/jira/browse/RANGER-1765
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Currently, concurrent request to create a group or create group-users mapping is causing duplicate entries of the same group in x_group table. This need to be restricted in DB tables by creating relevant constraint on the table.
> 
> 
> Diffs
> -----
> 
>   security-admin/db/mysql/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
>   security-admin/db/oracle/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
>   security-admin/db/postgres/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
>   security-admin/db/sqlanywhere/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
>   security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql 68d3a05 
>   security-admin/db/sqlserver/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/62074/diff/1/
> 
> 
> Testing
> -------
> 
> 1. Tested Ranger Admin, Usersync, Ranger KMS with all database flavour.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 62074: RANGER-1765 : Add unique key constraint in x_group and x_group_users table

Posted by Velmurugan Periasamy <vp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62074/#review185000
-----------------------------------------------------------


Ship it!




Ship It!

- Velmurugan Periasamy


On Sept. 8, 2017, 4:14 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62074/
> -----------------------------------------------------------
> 
> (Updated Sept. 8, 2017, 4:14 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-1765
>     https://issues.apache.org/jira/browse/RANGER-1765
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Currently, concurrent request to create a group or create group-users mapping is causing duplicate entries of the same group in x_group table. This need to be restricted in DB tables by creating relevant constraint on the table.
> 
> 
> Diffs
> -----
> 
>   security-admin/db/mysql/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
>   security-admin/db/oracle/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
>   security-admin/db/postgres/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
>   security-admin/db/sqlanywhere/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
>   security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql 68d3a05 
>   security-admin/db/sqlserver/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/62074/diff/1/
> 
> 
> Testing
> -------
> 
> 1. Tested Ranger Admin, Usersync, Ranger KMS with all database flavour.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 62074: RANGER-1765 : Add unique key constraint in x_group and x_group_users table

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62074/
-----------------------------------------------------------

(Updated Sept. 8, 2017, 4:14 a.m.)


Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


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


Repository: ranger


Description
-------

Currently, concurrent request to create a group or create group-users mapping is causing duplicate entries of the same group in x_group table. This need to be restricted in DB tables by creating relevant constraint on the table.


Diffs
-----

  security-admin/db/mysql/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
  security-admin/db/oracle/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
  security-admin/db/postgres/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
  security-admin/db/sqlanywhere/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
  security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql 68d3a05 
  security-admin/db/sqlserver/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 


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


Testing
-------

1. Tested Ranger Admin, Usersync, Ranger KMS with all database flavour.


Thanks,

bhavik patel


Re: Review Request 62074: RANGER-1765 : Add unique key constraint in x_group and x_group_users table

Posted by Velmurugan Periasamy <vp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62074/#review184892
-----------------------------------------------------------




security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
Line 2973 (original), 2986 (patched)
<https://reviews.apache.org/r/62074/#comment261090>

    This patch does not apply in ranger-0.7. Please fix it.
    
    ```
    $ git apply --check -v < ~/Downloads/RANGER-1765-master.patch
    Checking patch security-admin/db/mysql/patches/028-add-unique-constraint-on-table-x_group.sql...
    Checking patch security-admin/db/oracle/patches/028-add-unique-constraint-on-table-x_group.sql...
    Checking patch security-admin/db/postgres/patches/028-add-unique-constraint-on-table-x_group.sql...
    Checking patch security-admin/db/sqlanywhere/patches/028-add-unique-constraint-on-table-x_group.sql...
    Checking patch security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql...
    error: while searching for:
    INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('025',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
    INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('026',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
    INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('027',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
    INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('DB_PATCHES',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
    INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,3,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,1,1,1);
    INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,1,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,1,1,1);
    
    error: patch failed: security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql:2975
    error: security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql: patch does not apply
    Checking patch security-admin/db/sqlserver/patches/028-add-unique-constraint-on-table-x_group.sql...
    ```


- Velmurugan Periasamy


On Sept. 5, 2017, 6:24 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62074/
> -----------------------------------------------------------
> 
> (Updated Sept. 5, 2017, 6:24 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-1765
>     https://issues.apache.org/jira/browse/RANGER-1765
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Currently, concurrent request to create a group or create group-users mapping is causing duplicate entries of the same group in x_group table. This need to be restricted in DB tables by creating relevant constraint on the table.
> 
> 
> Diffs
> -----
> 
>   security-admin/db/mysql/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
>   security-admin/db/oracle/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
>   security-admin/db/postgres/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
>   security-admin/db/sqlanywhere/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
>   security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql 68d3a05 
>   security-admin/db/sqlserver/patches/028-add-unique-constraint-on-table-x_group.sql PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/62074/diff/1/
> 
> 
> Testing
> -------
> 
> 1. Tested Ranger Admin, Usersync, Ranger KMS with all database flavour.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>