[ 
https://issues.apache.org/jira/browse/RANGER-5186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anand Nadar updated RANGER-5186:
--------------------------------
    Description: 
In importservicetags api PUT - /service/tags/importservicetags
We have the tags section, which can have a owner key.
The value of the owner key can be 0 or 1.

Pirvate (OWNER_SERVICERESOURCE) value 0 - These tags should be unique withing a 
service-resource
Global  (OWNER_GLOBAL) value 1 – These Tags will be unique across all 
service-resources

is above the correct understanding?

Current behaviour
Case - If incoming tag is global
                 - Check if incoming tag is private
                       -No, return null
                              -Create a new tag and associate it with the 
resource.

This is not working as expected, as currently always global tags are being 
created without doing a match.

It should only create a global tag when there does not exist a global tag with 
the same tag type and attributes. (And a empty check on validity period)

Below could be the expected behaviour
 - We should get the list of all available global tags from database.
    - Compare it with the incoming global tag.
          - If it does not match - Then create a new global tag and associate 
it with the current resource.
         - If a match is found
             - Check if both do not have validity period
                 - If yes, then its an exact match. So we can just create a new 
tag-resource  association with the existing global tag and the current resource

                             - if No, at least one of them have a non empty 
validity period
                    then create a new global tag and associate it with the 
current resource.

I think global tag should never be updated as it will affect the existing tags.

  was:
In importservicetags api PUT - /service/tags/importservicetags
We have the tags section, which can have a owner key.
The value of the owner key can be 0 or 1.

Pirvate (OWNER_SERVICERESOURCE) value 0 - These tags should be unique withing a 
service-resource
Global  (OWNER_GLOBAL) value 1 – These Tags will be unique across all 
service-resources

Current behaviour
Case - If incoming tag is global
                 - Check if incoming tag is private
                       -No, return null
                              -Create a new tag and associate it with the 
resource.

This is not working as expected, as currently always global tags are being 
created without doing a match.

It should only create a global tag when there does not exist a global tag with 
the same tag type and attributes. (And a empty check on validity period)

Below could be the expected behaviour
 - We should get the list of all available global tags from database.
    - Compare it with the incoming global tag.
          - If it does not match - Then create a new global tag and associate 
it with the current resource.
         - If a match is found
             - Check if both do not have validity period
                 - If yes, then its an exact match. So we can just create a new 
tag-resource  association with the existing global tag and the current resource

                             - if No, at least one of them have a non empty 
validity period
                    then create a new global tag and associate it with the 
current resource.

I think global tag should never be updated as it will affect the existing tags.


> [Ranger-Admin] Global tags is not working as expected in importservicetags api
> ------------------------------------------------------------------------------
>
>                 Key: RANGER-5186
>                 URL: https://issues.apache.org/jira/browse/RANGER-5186
>             Project: Ranger
>          Issue Type: Bug
>          Components: admin
>            Reporter: Anand Nadar
>            Priority: Major
>
> In importservicetags api PUT - /service/tags/importservicetags
> We have the tags section, which can have a owner key.
> The value of the owner key can be 0 or 1.
> Pirvate (OWNER_SERVICERESOURCE) value 0 - These tags should be unique withing 
> a service-resource
> Global  (OWNER_GLOBAL) value 1 – These Tags will be unique across all 
> service-resources
> is above the correct understanding?
> Current behaviour
> Case - If incoming tag is global
>                  - Check if incoming tag is private
>                        -No, return null
>                               -Create a new tag and associate it with the 
> resource.
> This is not working as expected, as currently always global tags are being 
> created without doing a match.
> It should only create a global tag when there does not exist a global tag 
> with the same tag type and attributes. (And a empty check on validity period)
> Below could be the expected behaviour
>  - We should get the list of all available global tags from database.
>     - Compare it with the incoming global tag.
>           - If it does not match - Then create a new global tag and associate 
> it with the current resource.
>          - If a match is found
>              - Check if both do not have validity period
>                  - If yes, then its an exact match. So we can just create a 
> new tag-resource  association with the existing global tag and the current 
> resource
>                              - if No, at least one of them have a non empty 
> validity period
>                     then create a new global tag and associate it with the 
> current resource.
> I think global tag should never be updated as it will affect the existing 
> tags.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to