ATLAS-4988: BusinessMetadata with attribute of data type Array takes time to Delete.#490
Open
UmeshPatil-1 wants to merge 9 commits intoapache:masterfrom
Open
ATLAS-4988: BusinessMetadata with attribute of data type Array takes time to Delete.#490UmeshPatil-1 wants to merge 9 commits intoapache:masterfrom
UmeshPatil-1 wants to merge 9 commits intoapache:masterfrom
Conversation
sheetalshah1007
suggested changes
Dec 29, 2025
mneethiraj
reviewed
Dec 30, 2025
|
|
||
| return CollectionUtils.isNotEmpty(atlasSearchResult.getEntities()); | ||
| Iterable<AtlasVertex> vertices = graph.query() | ||
| .has(Constants.ENTITY_TYPE_PROPERTY_KEY, typeName) |
Contributor
There was a problem hiding this comment.
Is it necessary to add ENTITY_TYPE_PROPERTY_KEY filter here? If yes, note that all subTypes of types inapplicableTypes should be checked as well; consider a business attribute associated with a type like DataSet.
| Iterable<AtlasVertex> vertices = graph.query() | ||
| .has(Constants.ENTITY_TYPE_PROPERTY_KEY, typeName) | ||
| .has(vertexPropertyName, AtlasGraphQuery.ComparisionOperator.NOT_EQUAL, (Object) null) | ||
| .has(Constants.STATE_PROPERTY_KEY, AtlasEntity.Status.ACTIVE.name()) |
Contributor
There was a problem hiding this comment.
Is it necessary to check only for ACTIVE entities? The business metadata can't be deleted even when a deleted entity has reference to it, right?
pinal-shah
reviewed
Feb 4, 2026
0d5f0b8 to
f684d10
Compare
…e handling, enhance logging, and fix indexability gate. Added debug logs for force-flag behavior, clarified error messages, and improved query efficiency. Centralized validation logic and distinguished infrastructure errors. Added test coverage for mixed indexable/non-indexable BM deletion.
258064f to
554e951
Compare
sheetalshah1007
suggested changes
Mar 30, 2026
… and clean up BM logging and added testcases for these.
… updated testcases and added javadoc.
62d30c6 to
57e373e
Compare
…utes in test fixtures
sheetalshah1007
approved these changes
May 4, 2026
pinal-shah
requested changes
May 5, 2026
pinal-shah
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ATLAS-4988
What changes were proposed in this pull request?
Background: In Apache Atlas, deleting a Business Metadata (BM) definition requires a pre-check to ensure no existing entities are assigned to those attributes. For attributes with a data type of Array (multi-valued), the deletion process was taking an exceptionally long time (e.g., over 55 minutes for -1,18,300 entities), even when the BM was not assigned to any entity.
Root Cause:
ARRAY BM attributes are not indexed in Solr.
Solr therefore performs a full collection scan when queried with NOT_EMPTY, causing severe latency.
The previous logic forced all BM attributes (STRING + ARRAY) through Solr.
This was efficient for STRING attributes but pathological for ARRAY attributes.
The earlier implementation excluded deleted entities.
This allowed historical BM references to be missed, leading to potential integrity violations.
The Solr query requested attribute payloads, increasing I/O cost even though only existence was required.
Changes Proposed:
Impact:
Performance Gain: Deletion time for Business Metadata with Array attributes reduced from -55 minutes to -25 second's.
Reliability: Maintains strict data integrity by ensuring no "in-use" Business Metadata can be deleted.
Scalability: The fix ensures that as the number of entities grows, the deletion of metadata remains performant.
Correctness:Prevents deletion when BM is referenced by: Active entities, Deleted (historical) entities, Subtypes via inheritance and Custom entity types.
How was this patch tested?
Maven Build:
Build Successful.
Manual Testing:
The Patch was tested on cluster:- Result's as per below
1. Time taken to delete unassigned BM of String type :- Existing Code :- 2 sec - 4 sec, Updated Code:- 2 sec - 3 Sec.
2. Time taken to delete unassigned BM of Array type :- Existing Code :- 1 Hr 40 min, Updated Code:- 1.5 min - 3 min.
Please refer the attached sheet on JIRA-4988 ticket for more insight's