You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "Madhan Neethiraj (JIRA)" <ji...@apache.org> on 2019/03/12 05:26:00 UTC

[jira] [Commented] (ATLAS-3041) Cannot delete relationship types using the types/typedef/name REST API

    [ https://issues.apache.org/jira/browse/ATLAS-3041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16790243#comment-16790243 ] 

Madhan Neethiraj commented on ATLAS-3041:
-----------------------------------------

 

[@aadarshjajodia|https://github.com/aadarshjajodia] - can you look into the following unit-test failure? This is likely caused by the two new types added in this patch - cluster and host. Perhaps deleteTypeByName() should be updated to delete these types as well (along with other types)?

{code}
Tests run: 17, Failures: 1, Errors: 0, Skipped: 15, Time elapsed: 48.052 sec <<< FAILURE! - in org.apache.atlas.repository.store.graph.AtlasTypeDefGraphStoreTest.testGet(org.apache.atlas.repository.store.graph.AtlasTypeDefGraphStoreTest) Time elapsed: 0.026 sec <<< FAILURE!
java.lang.AssertionError: expected [0] but found [2]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:496)
at org.testng.Assert.assertEquals(Assert.java:125)
at org.testng.Assert.assertEquals(Assert.java:372)
at org.testng.Assert.assertEquals(Assert.java:382)
at org.apache.atlas.repository.store.graph.AtlasTypeDefGraphStoreTest.testGet(AtlasTypeDefGraphStoreTest.java:87)
{code}

 

> Cannot delete relationship types using the types/typedef/name REST API
> ----------------------------------------------------------------------
>
>                 Key: ATLAS-3041
>                 URL: https://issues.apache.org/jira/browse/ATLAS-3041
>             Project: Atlas
>          Issue Type: Bug
>          Components:  atlas-core
>    Affects Versions: 2.0.0
>            Reporter: Chris Clohosy
>            Assignee: Aadarsh Jajodia
>            Priority: Major
>         Attachments: ATLAS-3041.patch
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> It appears that relationship types cannot be deleted by doing a HTTP DELETE to the types/typedef/name REST API endpoint. Upon further exploration of the source code (org.apache.atlas.repository.store.graph.AtlasTypeDefGraphStore) the problem seems to lie within the deleteTypeByName method - this calls the getByName method and from logging we can observe it correctly gets back the AtlasRelationshipType. However there is no subsequent check for this type within deleteTypeByName, and as AtlasRelationshipTime extends AtlasStructType the code then thinks it needs to delete a struct instead of a relationship and therefore fails.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)