Skip to content

ATLAS-5321 : Fix basic search by glossary termName after parent gloss… - #705

Open
UmeshPatil-1 wants to merge 1 commit into
apache:masterfrom
UmeshPatil-1:ATLAS-5321
Open

ATLAS-5321 : Fix basic search by glossary termName after parent gloss…#705
UmeshPatil-1 wants to merge 1 commit into
apache:masterfrom
UmeshPatil-1:ATLAS-5321

Conversation

@UmeshPatil-1

@UmeshPatil-1 UmeshPatil-1 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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:-

  1. 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.

  2. 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.

  3. DataAccess.java (supporting API)
    3.1. -- Added savePartial() and savePartialNoLoad() methods that invoke entityStore.createOrUpdate(..., isPartialUpdate=true).

  4. 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

  • -Added AtlasDiscoveryServiceTest#termSearchAfterGlossaryUpdate
  • -Creates/finds the test glossary and term from existing test setup
  • -Performs basic search by termName (qualified name)
  • -Updates the glossary via GlossaryService.updateGlossary()
  • -Re-runs the same basic search and asserts it still succeeds

How was this patch tested?

Manual tests:-

  1. Created glossary (e.g. gloss5321test142500)
  2. Created term via POST /api/atlas/v2/glossary/term with anchor to glossary
  3. Ran POST /api/atlas/v2/search/basic with "termName": "term2@gloss5321test142500" → 200 OK, "queryType": "BASIC", no ATLAS-400-00-06E
  4. Updated glossary via:
  5. PUT /api/atlas/v2/glossary/{guid}/partial (partial update), and
  6. PUT /api/atlas/v2/glossary/{guid} (full update)
  7. Re-ran the same basic search → 200 OK, no ATLAS-400-00-06E
  8. Confirmed term still exists via GET /api/atlas/v2/glossary/term/{termGuid} with unchanged qualifiedName.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant