You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by John Speidel <js...@hortonworks.com> on 2016/06/01 00:42:35 UTC

Re: Review Request 47898: Implement Business Catalog Delete


> On May 27, 2016, 7:24 a.m., Hemanth Yamijala wrote:
> > webapp/src/main/java/org/apache/atlas/web/resources/BaseService.java, line 47
> > <https://reviews.apache.org/r/47898/diff/1/?file=1395490#file1395490line47>
> >
> >     Is this being done mainly as a defensive safeguard? If there is any exception, then I guess that transaction will remain open until any of these calls are made. I have seen long opened transactions cause problems and leaks in Titan. Preferable to ensure transactions are closed.
> 
> John Speidel wrote:
>     Yes, this is a safeguard to ensure correct behavior in the case where a thread is re-pooled with an active transaction.  Because of the way that transactions are implemented in Titan, this can easily happen. Even a simple read will start a transaction that may mutate the database as well as establish the point in time used for read object visibility.  I did see several cases recently where this did indeed happen and was unable to easily figure out where we missed a commit/rollback so I added this code at this time.  Ideally, this would be done via a Jersey interceptor which was invoked for all api requests.
>     
>     I absolutely agree that we should attempt to ensure proper transaction demarcation in all code paths, but that being said, I think that it is a good idea to have this "safety net" due to the likelihood that this will occur in the future. Unfortunately, I didn't see a way to determine if an active transaction is in place on the thread so that we could actually detect this scenario and log a warning instead of just blindly rolling back.
>     
>     Let me know if you are ok with closing this issue as is or if you would prefer that I resolve this issue another way.
> 
> Hemanth Yamijala wrote:
>     I would prefer this is addressed in this JIRA. I don't see these warnings without this patch, including when exercising existing add functionality of business terms.

I have been unable to reproduce this behavior after testing for over an hour.  I will keep an eye out for the log warning that you provided in the associated Jira.


- John


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/47898/#review135175
-----------------------------------------------------------


On May 27, 2016, 9:18 p.m., John Speidel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/47898/
> -----------------------------------------------------------
> 
> (Updated May 27, 2016, 9:18 p.m.)
> 
> 
> Review request for atlas and Hemanth Yamijala.
> 
> 
> Bugs: ATLAS-793
>     https://issues.apache.org/jira/browse/ATLAS-793
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> Provide support for deletion of taxonomies, terms and tags
> 
> 
> Diffs
> -----
> 
>   catalog/src/main/java/org/apache/atlas/catalog/AtlasTypeSystem.java 6f2e0be 
>   catalog/src/main/java/org/apache/atlas/catalog/BaseRequest.java f3376b0 
>   catalog/src/main/java/org/apache/atlas/catalog/BaseResourceProvider.java 517eaf6 
>   catalog/src/main/java/org/apache/atlas/catalog/DefaultTypeSystem.java f71c061 
>   catalog/src/main/java/org/apache/atlas/catalog/EntityTagResourceProvider.java dc4ab0d 
>   catalog/src/main/java/org/apache/atlas/catalog/ResourceProvider.java 4c4319c 
>   catalog/src/main/java/org/apache/atlas/catalog/TaxonomyResourceProvider.java 7a46f5d 
>   catalog/src/main/java/org/apache/atlas/catalog/TermResourceProvider.java 431b06d 
>   catalog/src/main/java/org/apache/atlas/catalog/projection/BaseRelation.java PRE-CREATION 
>   catalog/src/main/java/org/apache/atlas/catalog/projection/GenericRelation.java 5f59bea 
>   catalog/src/main/java/org/apache/atlas/catalog/projection/TagRelation.java a5e15c6 
>   catalog/src/main/java/org/apache/atlas/catalog/projection/TraitRelation.java 5f11474 
>   catalog/src/main/java/org/apache/atlas/catalog/query/AtlasEntityQuery.java e2bc597 
>   catalog/src/main/java/org/apache/atlas/catalog/query/AtlasEntityTagQuery.java 013bb8a 
>   catalog/src/main/java/org/apache/atlas/catalog/query/AtlasTaxonomyQuery.java 787f734 
>   catalog/src/main/java/org/apache/atlas/catalog/query/AtlasTermQuery.java 0065101 
>   catalog/src/main/java/org/apache/atlas/catalog/query/BaseQuery.java c2eabf7 
>   catalog/src/test/java/org/apache/atlas/catalog/EntityTagResourceProviderTest.java a95b966 
>   catalog/src/test/java/org/apache/atlas/catalog/TaxonomyResourceProviderTest.java 9cf3d12 
>   catalog/src/test/java/org/apache/atlas/catalog/TermResourceProviderTest.java 34222ca 
>   catalog/src/test/java/org/apache/atlas/catalog/projection/TagRelationTest.java PRE-CREATION 
>   catalog/src/test/java/org/apache/atlas/catalog/query/AtlasEntityQueryTest.java 838d4c1 
>   server-api/src/main/java/org/apache/atlas/services/MetadataService.java 6bca3df 
>   webapp/src/main/java/org/apache/atlas/web/resources/BaseService.java 3982df8 
>   webapp/src/main/java/org/apache/atlas/web/resources/EntityService.java 0e3f4c4 
>   webapp/src/main/java/org/apache/atlas/web/resources/TaxonomyService.java ccd0b62 
> 
> Diff: https://reviews.apache.org/r/47898/diff/
> 
> 
> Testing
> -------
> 
> - Added new unit tests
> - Ran all existing unit tests
> - Manual functional testing of all new functionality
> 
> 
> Thanks,
> 
> John Speidel
> 
>