ATLAS-5321 : Fix basic search by glossary termName after parent gloss… - #705
Open
UmeshPatil-1 wants to merge 1 commit into
Open
ATLAS-5321 : Fix basic search by glossary termName after parent gloss…#705UmeshPatil-1 wants to merge 1 commit into
UmeshPatil-1 wants to merge 1 commit into
Conversation
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.
What changes were proposed in this pull request?
Basic Search (POST /api/atlas/v2/search/basic) with the termName parameter fails with ATLAS-400-00-06E ("Unknown/invalid glossary term") after the parent glossary is updated, even though the term still exists and can be retrieved by GUID. This patch fixes term resolution in search and hardens glossary update persistence.
Root cause
SearchContext.getGlossaryTermVertex() used a raw JanusGraph composite query (entity type + qualifiedName + ACTIVE) to validate glossary terms. After a glossary update, this lookup could fail while the term remained in the graph. The rest of Atlas (GlossaryService, EntityStore, etc.) resolves terms via AtlasGraphUtilsV2.findByUniqueAttributes(), which uses the __u_qualifiedName global unique index.
Changes:-
SearchContext.java (primary fix)
1.1. --Updated getGlossaryTermVertex() to use AtlasGraphUtilsV2.findByUniqueAttributes() instead of a direct composite graph query.
1.2. --Added an explicit check that the resolved term vertex is in ACTIVE state before proceeding.
1.3. --Aligns Basic Search term validation with the canonical lookup used elsewhere in Atlas.
GlossaryService.java (hardening)
2.1. -- Updated updateGlossary() to clear in-memory terms and categories before persisting.
2.2. -- Switched from dataAccess.save() (full update) to dataAccess.savePartial() so glossary attribute-only changes use partial update semantics.
DataAccess.java (supporting API)
3.1. -- Added savePartial() and savePartialNoLoad() methods that invoke entityStore.createOrUpdate(..., isPartialUpdate=true).
AtlasDiscoveryServiceTest.java (regression test)
4.1. -- Added termSearchAfterGlossaryUpdate() to verify basic search by term qualified name succeeds both before and after a glossary update.
How was this patch tested?
Unit tests
How was this patch tested?
Manual tests:-