You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Pradeep Agrawal <pr...@freestoneinfotech.com> on 2017/02/28 06:53:52 UTC

Review Request 57123: RANGER-1407 : Service update transaction log is not generated in some cases

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

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


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


Repository: ranger


Description
-------

**Problem Statement:** If a Ranger service is updated to change its associated tag service name, then the service-update transaction log is not generated.

**Proposed Solution :** 'tagService' attribute of RangerService class need to be enabled for logging the changes in value of this attribute in RangerServiceService class.


Diffs
-----

  security-admin/src/main/java/org/apache/ranger/service/RangerServiceService.java 004524b 

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


Testing
-------

**Steps performed with patch : **
1. Installed and Started Ranger admin.
2. Created hdfs service 'hdfsdev'
3. Created Tagbased service 'tagdev'
4. Clicked on edit button of 'hdfsdev' service and updated tag service name to 'tagdev'
5. tag service name 'tagdev' got updated in 'hdfsdev'
6. visited Audit menu->Admin tab to check whether log for the tag service name update event is appearing or not.

**Expected Behaviour : **
Tag service name update log should appear under the Admin tab.

**Actual Behaviour : **
1. Tag service name update log was appearring under the Admin tab and after clicking on the log was able to see log details like given below : 

Fields : Tag Service Name
Old Value : --
New Value :tagdev

2. Created tag service 'tagdev1' and after changing tag service name of 'hdfsdev' to 'tagdev1 was able to see log details like given below : 

Fields : Tag Service Name
Old Value : tagdev
New Value :tagdev1

3. Also was able to see logs of removal of tag service name 'tagdev1' from service 'hdfsdev' like given below :
Fields : Tag Service Name
Old Value : tagdev1
New Value : --


Thanks,

Pradeep Agrawal


Re: Review Request 57123: RANGER-1407 : Service update transaction log is not generated in some cases

Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57123/#review167288
-----------------------------------------------------------


Ship it!




Ship It!

- Abhay Kulkarni


On March 1, 2017, 8:52 a.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57123/
> -----------------------------------------------------------
> 
> (Updated March 1, 2017, 8:52 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-1407
>     https://issues.apache.org/jira/browse/RANGER-1407
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** If a Ranger service is updated to change its associated tag service name, then the service-update transaction log is not generated.
> 
> **Proposed Solution :** 'tagService' attribute of RangerService class need to be enabled for logging the changes in value of this attribute in RangerServiceService class.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java a75c19a 
>   security-admin/src/main/java/org/apache/ranger/service/RangerServiceService.java 004524b 
> 
> 
> Diff: https://reviews.apache.org/r/57123/diff/3/
> 
> 
> Testing
> -------
> 
> **Steps performed with patch : **
> 1. Installed and Started Ranger admin.
> 2. Created hdfs service 'hdfsdev'
> 3. Created Tagbased service 'tagdev'
> 4. Clicked on edit button of 'hdfsdev' service and updated tag service name to 'tagdev'
> 5. tag service name 'tagdev' got updated in 'hdfsdev'
> 6. visited Audit menu->Admin tab to check whether log for the tag service name update event is appearing or not.
> 
> **Expected Behaviour : **
> Tag service name update log should appear under the Admin tab.
> 
> **Actual Behaviour : **
> 1. Tag service name update log was appearring under the Admin tab and after clicking on the log was able to see log details like given below : 
> 
> Fields : Tag Service Name
> Old Value : --
> New Value :tagdev
> 
> 2. Created tag service 'tagdev1' and after changing tag service name of 'hdfsdev' to 'tagdev1 was able to see log details like given below : 
> 
> Fields : Tag Service Name
> Old Value : tagdev
> New Value :tagdev1
> 
> 3. Also was able to see logs of removal of tag service name 'tagdev1' from service 'hdfsdev' like given below :
> Fields : Tag Service Name
> Old Value : tagdev1
> New Value : --
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>


Re: Review Request 57123: RANGER-1407 : Service update transaction log is not generated in some cases

Posted by Ramesh Mani <rm...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57123/#review167343
-----------------------------------------------------------


Ship it!




Ship It!

- Ramesh Mani


On March 1, 2017, 8:52 a.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57123/
> -----------------------------------------------------------
> 
> (Updated March 1, 2017, 8:52 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-1407
>     https://issues.apache.org/jira/browse/RANGER-1407
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** If a Ranger service is updated to change its associated tag service name, then the service-update transaction log is not generated.
> 
> **Proposed Solution :** 'tagService' attribute of RangerService class need to be enabled for logging the changes in value of this attribute in RangerServiceService class.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java a75c19a 
>   security-admin/src/main/java/org/apache/ranger/service/RangerServiceService.java 004524b 
> 
> 
> Diff: https://reviews.apache.org/r/57123/diff/3/
> 
> 
> Testing
> -------
> 
> **Steps performed with patch : **
> 1. Installed and Started Ranger admin.
> 2. Created hdfs service 'hdfsdev'
> 3. Created Tagbased service 'tagdev'
> 4. Clicked on edit button of 'hdfsdev' service and updated tag service name to 'tagdev'
> 5. tag service name 'tagdev' got updated in 'hdfsdev'
> 6. visited Audit menu->Admin tab to check whether log for the tag service name update event is appearing or not.
> 
> **Expected Behaviour : **
> Tag service name update log should appear under the Admin tab.
> 
> **Actual Behaviour : **
> 1. Tag service name update log was appearring under the Admin tab and after clicking on the log was able to see log details like given below : 
> 
> Fields : Tag Service Name
> Old Value : --
> New Value :tagdev
> 
> 2. Created tag service 'tagdev1' and after changing tag service name of 'hdfsdev' to 'tagdev1 was able to see log details like given below : 
> 
> Fields : Tag Service Name
> Old Value : tagdev
> New Value :tagdev1
> 
> 3. Also was able to see logs of removal of tag service name 'tagdev1' from service 'hdfsdev' like given below :
> Fields : Tag Service Name
> Old Value : tagdev1
> New Value : --
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>


Re: Review Request 57123: RANGER-1407 : Service update transaction log is not generated in some cases

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

(Updated March 1, 2017, 8:52 a.m.)


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


Changes
-------

Addressed review comments.


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


Repository: ranger


Description
-------

**Problem Statement:** If a Ranger service is updated to change its associated tag service name, then the service-update transaction log is not generated.

**Proposed Solution :** 'tagService' attribute of RangerService class need to be enabled for logging the changes in value of this attribute in RangerServiceService class.


Diffs (updated)
-----

  security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java a75c19a 
  security-admin/src/main/java/org/apache/ranger/service/RangerServiceService.java 004524b 


Diff: https://reviews.apache.org/r/57123/diff/3/

Changes: https://reviews.apache.org/r/57123/diff/2-3/


Testing
-------

**Steps performed with patch : **
1. Installed and Started Ranger admin.
2. Created hdfs service 'hdfsdev'
3. Created Tagbased service 'tagdev'
4. Clicked on edit button of 'hdfsdev' service and updated tag service name to 'tagdev'
5. tag service name 'tagdev' got updated in 'hdfsdev'
6. visited Audit menu->Admin tab to check whether log for the tag service name update event is appearing or not.

**Expected Behaviour : **
Tag service name update log should appear under the Admin tab.

**Actual Behaviour : **
1. Tag service name update log was appearring under the Admin tab and after clicking on the log was able to see log details like given below : 

Fields : Tag Service Name
Old Value : --
New Value :tagdev

2. Created tag service 'tagdev1' and after changing tag service name of 'hdfsdev' to 'tagdev1 was able to see log details like given below : 

Fields : Tag Service Name
Old Value : tagdev
New Value :tagdev1

3. Also was able to see logs of removal of tag service name 'tagdev1' from service 'hdfsdev' like given below :
Fields : Tag Service Name
Old Value : tagdev1
New Value : --


Thanks,

Pradeep Agrawal


Re: Review Request 57123: RANGER-1407 : Service update transaction log is not generated in some cases

Posted by Pradeep Agrawal <pr...@freestoneinfotech.com>.

> On March 1, 2017, 6:58 a.m., Ramesh Mani wrote:
> > security-admin/src/main/java/org/apache/ranger/service/RangerServiceService.java
> > Lines 266 (patched)
> > <https://reviews.apache.org/r/57123/diff/2/?file=1652517#file1652517line266>
> >
> >     !"null".equalsIgnoreCase(oldValue) is the check done because oldValue will have a string "null". if this check is only for null value please remove it.

Yes, old value may contain String "null" here.


- Pradeep


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


On March 1, 2017, 8:52 a.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57123/
> -----------------------------------------------------------
> 
> (Updated March 1, 2017, 8:52 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-1407
>     https://issues.apache.org/jira/browse/RANGER-1407
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** If a Ranger service is updated to change its associated tag service name, then the service-update transaction log is not generated.
> 
> **Proposed Solution :** 'tagService' attribute of RangerService class need to be enabled for logging the changes in value of this attribute in RangerServiceService class.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java a75c19a 
>   security-admin/src/main/java/org/apache/ranger/service/RangerServiceService.java 004524b 
> 
> 
> Diff: https://reviews.apache.org/r/57123/diff/3/
> 
> 
> Testing
> -------
> 
> **Steps performed with patch : **
> 1. Installed and Started Ranger admin.
> 2. Created hdfs service 'hdfsdev'
> 3. Created Tagbased service 'tagdev'
> 4. Clicked on edit button of 'hdfsdev' service and updated tag service name to 'tagdev'
> 5. tag service name 'tagdev' got updated in 'hdfsdev'
> 6. visited Audit menu->Admin tab to check whether log for the tag service name update event is appearing or not.
> 
> **Expected Behaviour : **
> Tag service name update log should appear under the Admin tab.
> 
> **Actual Behaviour : **
> 1. Tag service name update log was appearring under the Admin tab and after clicking on the log was able to see log details like given below : 
> 
> Fields : Tag Service Name
> Old Value : --
> New Value :tagdev
> 
> 2. Created tag service 'tagdev1' and after changing tag service name of 'hdfsdev' to 'tagdev1 was able to see log details like given below : 
> 
> Fields : Tag Service Name
> Old Value : tagdev
> New Value :tagdev1
> 
> 3. Also was able to see logs of removal of tag service name 'tagdev1' from service 'hdfsdev' like given below :
> Fields : Tag Service Name
> Old Value : tagdev1
> New Value : --
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>


Re: Review Request 57123: RANGER-1407 : Service update transaction log is not generated in some cases

Posted by Ramesh Mani <rm...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57123/#review167213
-----------------------------------------------------------




security-admin/src/main/java/org/apache/ranger/service/RangerServiceService.java
Lines 265 (patched)
<https://reviews.apache.org/r/57123/#comment239377>

    Please consider doing this check as "tagservice".equalsIgnoreCase(fieldName)



security-admin/src/main/java/org/apache/ranger/service/RangerServiceService.java
Lines 266 (patched)
<https://reviews.apache.org/r/57123/#comment239378>

    !"null".equalsIgnoreCase(oldValue) is the check done because oldValue will have a string "null". if this check is only for null value please remove it.


- Ramesh Mani


On March 1, 2017, 6:24 a.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57123/
> -----------------------------------------------------------
> 
> (Updated March 1, 2017, 6:24 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-1407
>     https://issues.apache.org/jira/browse/RANGER-1407
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** If a Ranger service is updated to change its associated tag service name, then the service-update transaction log is not generated.
> 
> **Proposed Solution :** 'tagService' attribute of RangerService class need to be enabled for logging the changes in value of this attribute in RangerServiceService class.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java a75c19a 
>   security-admin/src/main/java/org/apache/ranger/service/RangerServiceService.java 004524b 
> 
> 
> Diff: https://reviews.apache.org/r/57123/diff/2/
> 
> 
> Testing
> -------
> 
> **Steps performed with patch : **
> 1. Installed and Started Ranger admin.
> 2. Created hdfs service 'hdfsdev'
> 3. Created Tagbased service 'tagdev'
> 4. Clicked on edit button of 'hdfsdev' service and updated tag service name to 'tagdev'
> 5. tag service name 'tagdev' got updated in 'hdfsdev'
> 6. visited Audit menu->Admin tab to check whether log for the tag service name update event is appearing or not.
> 
> **Expected Behaviour : **
> Tag service name update log should appear under the Admin tab.
> 
> **Actual Behaviour : **
> 1. Tag service name update log was appearring under the Admin tab and after clicking on the log was able to see log details like given below : 
> 
> Fields : Tag Service Name
> Old Value : --
> New Value :tagdev
> 
> 2. Created tag service 'tagdev1' and after changing tag service name of 'hdfsdev' to 'tagdev1 was able to see log details like given below : 
> 
> Fields : Tag Service Name
> Old Value : tagdev
> New Value :tagdev1
> 
> 3. Also was able to see logs of removal of tag service name 'tagdev1' from service 'hdfsdev' like given below :
> Fields : Tag Service Name
> Old Value : tagdev1
> New Value : --
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>


Re: Review Request 57123: RANGER-1407 : Service update transaction log is not generated in some cases

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

(Updated March 1, 2017, 6:24 a.m.)


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


Changes
-------

Addressed review comments


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


Repository: ranger


Description
-------

**Problem Statement:** If a Ranger service is updated to change its associated tag service name, then the service-update transaction log is not generated.

**Proposed Solution :** 'tagService' attribute of RangerService class need to be enabled for logging the changes in value of this attribute in RangerServiceService class.


Diffs (updated)
-----

  security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java a75c19a 
  security-admin/src/main/java/org/apache/ranger/service/RangerServiceService.java 004524b 


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

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


Testing
-------

**Steps performed with patch : **
1. Installed and Started Ranger admin.
2. Created hdfs service 'hdfsdev'
3. Created Tagbased service 'tagdev'
4. Clicked on edit button of 'hdfsdev' service and updated tag service name to 'tagdev'
5. tag service name 'tagdev' got updated in 'hdfsdev'
6. visited Audit menu->Admin tab to check whether log for the tag service name update event is appearing or not.

**Expected Behaviour : **
Tag service name update log should appear under the Admin tab.

**Actual Behaviour : **
1. Tag service name update log was appearring under the Admin tab and after clicking on the log was able to see log details like given below : 

Fields : Tag Service Name
Old Value : --
New Value :tagdev

2. Created tag service 'tagdev1' and after changing tag service name of 'hdfsdev' to 'tagdev1 was able to see log details like given below : 

Fields : Tag Service Name
Old Value : tagdev
New Value :tagdev1

3. Also was able to see logs of removal of tag service name 'tagdev1' from service 'hdfsdev' like given below :
Fields : Tag Service Name
Old Value : tagdev1
New Value : --


Thanks,

Pradeep Agrawal


Re: Review Request 57123: RANGER-1407 : Service update transaction log is not generated in some cases

Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57123/#review167156
-----------------------------------------------------------



In addition to changes in this patch, Consider moving line 1491 in ServiceDBStore.java:

List<XXTrxLog> trxLogList = svcService.getTransactionLog(service, existing, RangerServiceService.OPERATION_UPDATE_CONTEXT)

to after line 1507, preferably just before line 1532:

		if(populateExistingBaseFields) {
        
This is to ensure that for old clients, the setting of tagServiceName in new RangerService object, if required, is performed by line 1502:

				service.setTagService(newTagServiceName);
                
and transaction-log contains correct values in the case of old client.

- Abhay Kulkarni


On Feb. 28, 2017, 6:53 a.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57123/
> -----------------------------------------------------------
> 
> (Updated Feb. 28, 2017, 6:53 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-1407
>     https://issues.apache.org/jira/browse/RANGER-1407
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** If a Ranger service is updated to change its associated tag service name, then the service-update transaction log is not generated.
> 
> **Proposed Solution :** 'tagService' attribute of RangerService class need to be enabled for logging the changes in value of this attribute in RangerServiceService class.
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/service/RangerServiceService.java 004524b 
> 
> Diff: https://reviews.apache.org/r/57123/diff/
> 
> 
> Testing
> -------
> 
> **Steps performed with patch : **
> 1. Installed and Started Ranger admin.
> 2. Created hdfs service 'hdfsdev'
> 3. Created Tagbased service 'tagdev'
> 4. Clicked on edit button of 'hdfsdev' service and updated tag service name to 'tagdev'
> 5. tag service name 'tagdev' got updated in 'hdfsdev'
> 6. visited Audit menu->Admin tab to check whether log for the tag service name update event is appearing or not.
> 
> **Expected Behaviour : **
> Tag service name update log should appear under the Admin tab.
> 
> **Actual Behaviour : **
> 1. Tag service name update log was appearring under the Admin tab and after clicking on the log was able to see log details like given below : 
> 
> Fields : Tag Service Name
> Old Value : --
> New Value :tagdev
> 
> 2. Created tag service 'tagdev1' and after changing tag service name of 'hdfsdev' to 'tagdev1 was able to see log details like given below : 
> 
> Fields : Tag Service Name
> Old Value : tagdev
> New Value :tagdev1
> 
> 3. Also was able to see logs of removal of tag service name 'tagdev1' from service 'hdfsdev' like given below :
> Fields : Tag Service Name
> Old Value : tagdev1
> New Value : --
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>