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

Jeffrey Hagelberg updated ATLAS-991:
------------------------------------
    Description: 
It is often the case multiple entities get deleted at the same time.  The 
current delete logic does not compute the delete closure up front, so it is 
possible for the processing of a particular Entity to trigger a lower bound 
violation in an entity that will be deleted but has not been processed yet.

Here's a simple test that can be added to 
GraphBackedMetatadataRepositoryDeleteTestBase to reproduce the issue:
{{monospaced}}
    @Test
    public void testLowerBoundsIgnoredOnDeletedEntities() throws Exception {
        
        String hrDeptGuid = createHrDeptGraph();
        ITypedReferenceableInstance hrDept = 
repositoryService.getEntityDefinition(hrDeptGuid);
        Map<String, String> nameGuidMap = getEmployeeNameGuidMap(hrDept);

        ITypedReferenceableInstance john = 
repositoryService.getEntityDefinition(nameGuidMap.get("John"));
        String johnGuid = john.getId()._getId();

        ITypedReferenceableInstance max = 
repositoryService.getEntityDefinition(nameGuidMap.get("Max"));
        String maxGuid = max.getId()._getId();
        
        ITypedReferenceableInstance jane = 
repositoryService.getEntityDefinition(nameGuidMap.get("Jane"));
        String janeGuid = jane.getId()._getId();
        
        //the lower bound constraint on jane.subordinates should not be 
enforced since jane is being deleted
        deleteEntities(johnGuid, maxGuid, janeGuid);
        
    }
{{monospaced}}

  was:
It is often the case multiple entities get deleted at the same time.  The 
current delete logic does not compute the delete closure up front, so it is 
possible for the processing of a particular Entity to trigger a lower bound 
violation in an entity that will be deleted but has not been processed yet.

Here's a simple test that can be added to 
GraphBackedMetatadataRepositoryDeleteTestBase to reproduce the issue:
{{
    @Test
    public void testLowerBoundsIgnoredOnDeletedEntities() throws Exception {
        
        String hrDeptGuid = createHrDeptGraph();
        ITypedReferenceableInstance hrDept = 
repositoryService.getEntityDefinition(hrDeptGuid);
        Map<String, String> nameGuidMap = getEmployeeNameGuidMap(hrDept);

        ITypedReferenceableInstance john = 
repositoryService.getEntityDefinition(nameGuidMap.get("John"));
        String johnGuid = john.getId()._getId();

        ITypedReferenceableInstance max = 
repositoryService.getEntityDefinition(nameGuidMap.get("Max"));
        String maxGuid = max.getId()._getId();
        
        ITypedReferenceableInstance jane = 
repositoryService.getEntityDefinition(nameGuidMap.get("Jane"));
        String janeGuid = jane.getId()._getId();
        
        //the lower bound constraint on jane.subordinates should not be 
enforced since jane is being deleted
        deleteEntities(johnGuid, maxGuid, janeGuid);
        
    }
||


> Lower bound checking not always disabled for Entities being deleted
> -------------------------------------------------------------------
>
>                 Key: ATLAS-991
>                 URL: https://issues.apache.org/jira/browse/ATLAS-991
>             Project: Atlas
>          Issue Type: Bug
>            Reporter: Jeffrey Hagelberg
>            Assignee: David Kantor
>
> It is often the case multiple entities get deleted at the same time.  The 
> current delete logic does not compute the delete closure up front, so it is 
> possible for the processing of a particular Entity to trigger a lower bound 
> violation in an entity that will be deleted but has not been processed yet.
> Here's a simple test that can be added to 
> GraphBackedMetatadataRepositoryDeleteTestBase to reproduce the issue:
> {{monospaced}}
>     @Test
>     public void testLowerBoundsIgnoredOnDeletedEntities() throws Exception {
>         
>         String hrDeptGuid = createHrDeptGraph();
>         ITypedReferenceableInstance hrDept = 
> repositoryService.getEntityDefinition(hrDeptGuid);
>         Map<String, String> nameGuidMap = getEmployeeNameGuidMap(hrDept);
>         ITypedReferenceableInstance john = 
> repositoryService.getEntityDefinition(nameGuidMap.get("John"));
>         String johnGuid = john.getId()._getId();
>         ITypedReferenceableInstance max = 
> repositoryService.getEntityDefinition(nameGuidMap.get("Max"));
>         String maxGuid = max.getId()._getId();
>         
>         ITypedReferenceableInstance jane = 
> repositoryService.getEntityDefinition(nameGuidMap.get("Jane"));
>         String janeGuid = jane.getId()._getId();
>         
>         //the lower bound constraint on jane.subordinates should not be 
> enforced since jane is being deleted
>         deleteEntities(johnGuid, maxGuid, janeGuid);
>         
>     }
> {{monospaced}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to