You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Qiang Zhang <zh...@zte.com.cn> on 2017/01/19 07:25:03 UTC

Review Request 55709: There were logic errors in create_rangerdb_user and grant_xa_db_user function.

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

Review request for ranger, Don Bosco Durai, Colm O hEigeartaigh, Ramesh Mani, Selvamohan Neethiraj, and Velmurugan Periasamy.


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


Repository: ranger


Description
-------

There were logic errors in create_rangerdb_user and grant_xa_db_user function.
The reason for the error is that the hosts_arr variable was set ["%", "localhost"] as default value at the beginning. The hosts_arr variable will include two localhost values if self.host equal to localhost. As a result, the back code block will be executed repeatedly, the performance of the program will be reduced. The error code is following:
hosts_arr =["%", "localhost"]
hosts_arr.append(self.host)
for host in hosts_arr:
business logic code block
From the above code logic we can be seen that the business logic code block will be repeated twice when the db_host attribute is set to localhost in install.properties.


Diffs
-----

  security-admin/scripts/dba_script.py e5a1f59 

Diff: https://reviews.apache.org/r/55709/diff/


Testing
-------


Thanks,

Qiang Zhang


Re: Review Request 55709: There were logic errors in create_rangerdb_user and grant_xa_db_user function.

Posted by Colm O hEigeartaigh <co...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55709/#review164479
-----------------------------------------------------------


Ship it!




Ship It!

- Colm O hEigeartaigh


On Jan. 19, 2017, 7:25 a.m., Qiang Zhang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55709/
> -----------------------------------------------------------
> 
> (Updated Jan. 19, 2017, 7:25 a.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Colm O hEigeartaigh, Ramesh Mani, Selvamohan Neethiraj, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-1293
>     https://issues.apache.org/jira/browse/RANGER-1293
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> There were logic errors in create_rangerdb_user and grant_xa_db_user function.
> The reason for the error is that the hosts_arr variable was set ["%", "localhost"] as default value at the beginning. The hosts_arr variable will include two localhost values if self.host equal to localhost. As a result, the back code block will be executed repeatedly, the performance of the program will be reduced. The error code is following:
> hosts_arr =["%", "localhost"]
> hosts_arr.append(self.host)
> for host in hosts_arr:
> business logic code block
> From the above code logic we can be seen that the business logic code block will be repeated twice when the db_host attribute is set to localhost in install.properties.
> 
> 
> Diffs
> -----
> 
>   security-admin/scripts/dba_script.py e5a1f59 
> 
> Diff: https://reviews.apache.org/r/55709/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Qiang Zhang
> 
>