[
https://issues.apache.org/jira/browse/ATLAS-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16835325#comment-16835325
]
Madhan Neethiraj commented on ATLAS-3135:
-----------------------------------------
[~heary-cao] - thanks for reporting the issue and the details. I was able to
reproduce the issue. Here is background/root cause for the issue:
- an instance of AtlasTypeRegistry is used to perform consistency checks
(resolve references between types) and cache the types in-memory
- for any typedef changes (add/update/delete of types):
## Atlas creates a transient-type-registry with copy of types in
AtaslTypeResgistry
## perform the necessary changes in the transient-type-registry
## resolve references to ensure that type changes don't break consistency
## copy the types from transient-type-registry to AtlasTypeRegistry
- when delete is called with empty typesdef, #3 above is not performed,
resulting in AtlasTypeRegistry in unresolved state - which causes the issues
reported in this JIRA.
So, the correct fix will be to resolve-references (#3 above) in all typedef
update calls. Attached patch file [^ATLAS-3135.patch] has this fix; I verified
that this addresses the issue reported here. While the patch you provided
addresses the issue with empty typesdef, the fix in [^ATLAS-3135.patch]
handles all calls that can update types-registry. Please review this patch and
let me know your feedback.
> delete null data from typedefs results in messy data
> ----------------------------------------------------
>
> Key: ATLAS-3135
> URL: https://issues.apache.org/jira/browse/ATLAS-3135
> Project: Atlas
> Issue Type: Bug
> Components: atlas-core
> Affects Versions: 1.1.0
> Reporter: caoxuewen
> Priority: Major
> Fix For: 1.1.0
>
> Attachments: ATLAS-3135.patch, image-2019-04-13-11-45-12-868.png,
> image-2019-04-13-11-45-20-381.png, image-2019-04-13-11-45-32-642.png,
> image-2019-04-13-11-45-39-847.png, image-2019-04-13-11-45-47-698.png,
> image-2019-04-13-11-46-23-779.png
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Currently, when we use
> [http://IP:21000/api/atlas/v2/types/typedefs/|http://ip:21000/api/atlas/v2/types/typedefs/],
> deleting the data of typedefs is empty
> (\{"enumDefs":[],"structDefs":[],"classificationDefs":[],"entityDefs":[],"relationshipDefs":[]}),
> it will lead to messy data, and basic search error, so the atlas system must
> be restarted in order to recover the data.
> Correct data:
> !image-2019-04-13-11-45-12-868.png!
> !image-2019-04-13-11-45-20-381.png!
>
> exec
> [http://IP:21000/api/atlas/v2/types/typedefs/|http://ip:21000/api/atlas/v2/types/typedefs/],
> json data:
> \{"enumDefs":[],"structDefs":[],"classificationDefs":[],"entityDefs":[],"relationshipDefs":[]}
> atlas entity data is: (basic search is error)
> !image-2019-04-13-11-45-32-642.png!
> messy data:
> !image-2019-04-13-11-45-39-847.png!
> !image-2019-04-13-11-46-23-779.png!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)