Skip to content

Fixes 36215: Widen task aboutFqnHash and repoint tasks on every FQN change (2.1) - #36340

Merged
yan-3005 merged 1 commit into
2.1from
yan-3005/entity-fqn-hash-2.1
Oct 27, 2026
Merged

yan-3005 merged 1 commit into
2.1from
yan-3005/entity-fqn-hash-2.1

Conversation

@yan-3005

@yan-3005 yan-3005 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #36215

Backport of #36246 to 2.1. Same change, applied cleanly; see #36246 for the full design and review discussion. The 2.0 backport is #36262.

  • Migration (2.0.8): widens task_entity.aboutFqnHash and domain_entity.fqnHash from 256 to 768 (MySQL aboutFqnHash → ascii_bin, so idx_status_about stays under InnoDB's 3072-byte key limit). Fixes task create / glossary-term move failing with value too long for type character varying(256) at 8+ levels, and 8th-level subdomains. 2.0.7 is released and untouched.
  • Tasks follow every rename/move: EntityUpdater.storeUpdate repoints aboutFqnHash and workflow instances when the stored FQN changed — exact match for the entity's own type, hash.% prefix for the types nested under it (getNestedFqnEntityTypes()), in one statement and scoped by the task's about relationship type. Workflow-instance links are LIKE-escaped.

Type of change:

  • Bug fix

Tests:

Run on this branch (-DintegrationTests.lane=parallel): TaskAboutFqnChangeIT (8), GlossaryTermResourceIT#test_createTaskAboutEighthLevelTerm, #test_moveTermWithTaskToEighthLevel_repointsTask, DomainResourceIT#test_createEighthLevelSubDomain, ContinuousMigrationIT (3):

  • postgres-opensearch: Tests run: 14, Failures: 0, Errors: 0, Skipped: 0
  • mysql-elasticsearch: Tests run: 14, Failures: 0, Errors: 0, Skipped: 0

Broader regression runs and the before/after evidence are on #36246.

Checklist:

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking gap in workflow-history tests.

Findings

  1. P2 Workflow history changes lack tests ▶

Summary

Widens task and domain FQN hashes to support deeper hierarchies, and moves task and workflow links from the shared entity storage path.

  • Tasks and workflow history follow entities when their names or parents change.
  • Deep domains and task links now fit longer names.

Acknowledgment: yan-3005 supplied a decision record that explicitly defers type-scoped task listings and excludes the ingestion-only deferred storage path.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Store entity update] --> B{Stored FQN changed?}
  B -->|No| C[Leave task and workflow links unchanged]
  B -->|Yes| D[Rewrite task hashes by entity type]
  D --> E[Match own tasks exactly]
  D --> F[Match declared descendants by hash prefix]
  E --> G[Repoint workflow links]
  F --> G
Loading

Reviews (1) · Last reviewed commit: "Fixes 36215: Widen task aboutFqnHash and..." · Reviewed by Greptile

…hange

Backport of #36246 to 2.1.

An FQN hash is one 32-char md5 per level, so anything eight or more levels
deep (263+ chars) overflowed task_entity.aboutFqnHash and
domain_entity.fqnHash, both varchar(256). The 2.0.8 migration widens both
to 768 (ascii_bin on MySQL so idx_status_about stays under InnoDB's
3072-byte key limit).

Tasks also lost their entity whenever an FQN changed outside the glossary.
The rewrite now runs once from EntityUpdater.storeUpdate when the stored
FQN changed: one statement matching the entity's own type by exact hash
and the types nested under it (getNestedFqnEntityTypes) by hash prefix,
scoped through the task's about relationship so a same-named entity of
another type keeps its tasks. Workflow-instance links are repointed the
same way, with LIKE wildcards escaped.
@yan-3005
yan-3005 requested a review from a team as a code owner October 27, 2026 11:46
@yan-3005
yan-3005 requested review from IceS2 and removed request for a team October 27, 2026 11:46
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Oct 27, 2026
@gitar-bot

gitar-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🔴 High risk · Widening persisted FQN-hash columns and rewriting task and workflow links on renames could misassociate records or cause migration failures.

Widens task_entity.aboutFqnHash and domain_entity.fqnHash to 768 via migration 2.0.8 and repoints tasks and workflow instances whenever a stored FQN changes in EntityUpdater.storeUpdate. Fixes task creation and glossary-term moves failing at 8+ hierarchy levels. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

Comment on lines +2915 to +2919
String escapedStem = ListFilter.escapeLikeBindValue(oldStem);
String oldChildPrefix =
includeNested
? escapedStem + Entity.SEPARATOR + "%"
: ListFilter.escapeLikeBindValue(oldLink);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Workflow history changes lack tests

The new workflow-link rewrite has no regression test. TaskAboutFqnChangeIT only checks task listings, so it would still pass if workflow history stayed at the old name or matched another name containing % or _.

Add a test that creates workflow instances, renames their parent, and checks both the moved links and an unrelated link with a similar name.

@yan-3005
yan-3005 merged commit 006dda4 into 2.1 Oct 27, 2026
65 of 71 checks passed
@yan-3005
yan-3005 deleted the yan-3005/entity-fqn-hash-2.1 branch October 27, 2026 17:29
@yan-3005 yan-3005 self-assigned this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants