atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Madhan Neethiraj (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (ATLAS-1879) Updating classification removes some properties
Date Fri, 30 Jun 2017 20:32:00 GMT

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

Madhan Neethiraj edited comment on ATLAS-1879 at 6/30/17 8:31 PM:
------------------------------------------------------------------

bq. I understand the problem is the updateTypesDef method updates the TypeRegistry first,
then the GraphStorage
[~bpgergo] - you are right. This is the source of the problem. However, updating TypeRegistry
before GraphStorage is by design, as validations (like existence of referenced types, etc)
are performed in this stage. If there are any failures in the validation, the call bails out
without making any changes to the graph.

I think the simple fix you suggested (shown below) is good. This does have an overhead of
resolving references the second time; but alternate solution could be more involved. I would
suggest to go with this fix.

Also, this fix will address another issue reported by [~LauraNgo] - ATLAS-1895.

{code}
AtlasTypesDef ret = updateGraphStore(typesDef, ttr);

// add the following block to fix the issue
try {
    ttr.updateTypes(ret);
} catch (AtlasBaseException e) { // this shouldn't happen, as the types were already validated
  LOG.error("failed to update the registry after updating the store", e);
}
{code}



was (Author: madhan.neethiraj):
bq. I understand the problem is the updateTypesDef method updates the TypeRegistry first,
then the GraphStorage
[~bpgergo] - you are right. This is the source of the problem. However, updating TypeRegistry
before GraphStorage is by design, as validations (like existence of referenced types, etc)
are performed in this stage. If there are any failures in the validation, the call bails out
without making any changes to the graph.

I think the simple fix you suggested (shown below) is good. This does have an overhead of
resolving references the second time; but alternate solution could be more involved. I would
suggest to go with this fix.

{code}
AtlasTypesDef ret = updateGraphStore(typesDef, ttr);

// add the following block to fix the issue
try {
    ttr.updateTypes(ret);
} catch (AtlasBaseException e) { // this shouldn't happen, as the types were already validated
  LOG.error("failed to update the registry after updating the store", e);
}
{code}


> Updating classification removes some properties
> -----------------------------------------------
>
>                 Key: ATLAS-1879
>                 URL: https://issues.apache.org/jira/browse/ATLAS-1879
>             Project: Atlas
>          Issue Type: Bug
>          Components:  atlas-core
>    Affects Versions: 0.8-incubating
>            Reporter: Laura Ngo
>         Attachments: Atlas-1789.postman_collection.json
>
>
> * Created classification via POST. 
> * Updated via PUT
> * Lost properties
> POST http://127.0.0.1:21000/api/atlas/v2/types/typedefs
> {code}
> {
>  "classificationDefs": [{
>   "name": "test_classification_11",
>   "description": "",
>   "createdBy" : "admin",
>   "superTypes": [],
>   "attributeDefs": [{
>     "name" : "test_class_11",
>     "typeName" : "string",
>     "isOptional" : true,
>     "isUnique" : true,
>     "isIndexable" : true,
>     "cardinality": "SINGLE",
>     "valuesMinCount": 0,
>     "valuesMaxCount": 1
> }]
>  }],
>  "entityDefs": [],
>  "enumDefs": [],
>  "structDefs": []
> }
> {code}
> GET http://127.0.0.1:21000/api/atlas/v2/types/classification/name/test_classification_11
> {code}
> {
> "category": "CLASSIFICATION",
> "guid": "83162fe1-4bb4-4a87-b2b8-364e751a1265",
> "createdBy": "admin",
> "createTime": 1497485890857,
> "updateTime": 1497485890857,
> "version": 1,
> "name": "test_classification_11",
> "description": "",
> "typeVersion": "1.0",
> "attributeDefs": [
>   {
> "name": "test_class_11",
> "typeName": "string",
> "isOptional": true,
> "cardinality": "SINGLE",
> "valuesMinCount": 0,
> "valuesMaxCount": 1,
> "isUnique": true,
> "isIndexable": true
> }
> ],
> "superTypes": [],
> }
> {code}
> PUT http://127.0.0.1:21000/api/atlas/v2/types/typedefs
> Update attribute.
> GET http://127.0.0.1:21000/api/atlas/v2/types/classification/name/test_classification_11
> {code}
> {
> "category": "CLASSIFICATION",
> "createdBy": "admin",
> "name": "test_classification_11",
> "description": "",
> "attributeDefs": [
>   {
> "name": "test_class_11",
> "typeName": "string",
> "isOptional": true,
> "cardinality": "SINGLE",
> "valuesMinCount": 0,
> "valuesMaxCount": 1,
> "isUnique": true,
> "isIndexable": false
> }
> ],
> "superTypes": [],
> }
> {code}
> Some properties are missing after PUT update of attribute "isIndexable"



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message