Repository navigation
Fixes 36215: Widen task aboutFqnHash and repoint tasks on every FQN change - #36246
Conversation
…hange 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): tasks on deep entities could not be created, moving a glossary term with tasks that deep failed, and eighth-level subdomains could not be created. The 2.1.0 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: only Glossary and GlossaryTerm rewrote aboutFqnHash, so renaming a domain, tag, classification or data product, or moving a tag or container, left the tasks under the old FQN. The rewrite now runs once from EntityUpdater.storeUpdate for any entity whose FQN changed, as a single prefix update over the entity and its subtree, scoped to the subtree's entity types through the task's about relationship. The old glossary-only path matched the hash alone, so renaming domain X also moved the tasks of glossary X; the type scope prevents that.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
A prefix match on the entity's own type moved the tasks of an unrelated entity whose bare-name FQN contains a dot (metric "X.Y" hashes under metric "X"). The entity's own tasks and workflow instances now move on an exact match; only the types a repository declares as nested under its FQN (getNestedFqnEntityTypes) move by prefix. The repoint also runs only when the update stored the entity, so a rename the updater drops moves nothing.
The fix ships in 2.0.x, so the column widening moves from 2.1.0 to 2.0.7. A database already on 2.1.0 still runs it: the migration runner reprocesses the latest executed version of the previous release train too. The task rewrite is now one statement matching the entity's own type by exact hash or a nested type by hash prefix, so a row the exact match moved can no longer match the prefix again (moving page A under a root page named A.B). The workflow-instance repoint escapes LIKE wildcards in the link and runs once per type for the same reason.
# Conflicts: # bootstrap/sql/migrations/native/2.0.7/mysql/schemaChanges.sql # bootstrap/sql/migrations/native/2.0.7/postgres/schemaChanges.sql
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
2.0.7 is released, so the task_entity.aboutFqnHash and domain_entity.fqnHash widening moves to 2.0.8; 2.0.7 matches main again.
Code Review ✅ Approved🔴 High risk · MySQL’s table-copy migration to widen FQN hashes could burden upgrades; the shared hook could mis-repoint task/workflow links across entity types. Widens task VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
…hange (#36340) 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.
…hange (2.0) (#36262) * Fixes 36215: Widen task aboutFqnHash and repoint tasks on every FQN change Backport of #36246 to 2.0. 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.7 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. 2.0-specific: the task DAO change lives in CollectionDAO.TaskDAO, the glossary repositories keep updating legacy threads, and ListFilter.escapeLikeBindValue is added as on main. * Move the hash-width migration to 2.0.8 2.0.7 is released, so the task_entity.aboutFqnHash and domain_entity.fqnHash widening moves to a new 2.0.8 version; 2.0.7 matches 2.0 again.
Describe your changes:
Fixes #36215
1. The varchar(256) overflow (the issue). An FQN hash is one 32-char md5 per level joined by dots (
33 × levels − 1chars), so anything 8+ levels deep (263+ chars) overflowed twovarchar(256)columns:task_entity.aboutFqnHash: creating a task on an 8+-level entity failed, and moving a glossary term that has tasks to 8+ levels failed (TaskDAO.updateAboutFqnHashBatch ... value too long for type character varying(256)).domain_entity.fqnHash: an 8th-level subdomain could not be created.The 2.0.8 migration widens both to 768, matching the table and container FQN hash columns. On MySQL
aboutFqnHashalso moves toascii_binlike the other hash columns: at utf8mb4, 768 chars pushidx_status_about (status, aboutFqnHash)past InnoDB's 3072-byte key limit (ERROR 1071).2. Tasks lost their entity on most FQN changes. Only Glossary and GlossaryTerm rewrote
aboutFqnHashon a rename or move. Renaming a domain, tag, classification or data product, or moving a tag or container, left the tasks under the old FQN, so they vanished from the entity's task list. Even the glossary rename skipped the glossary's own tasks. The glossary path also matched the hash alone: a domain and a glossary both namedXshare the hash, so renaming one moved the other's tasks.The rewrite now runs once from
EntityUpdater.storeUpdate/storeUpdateWithOptimisticLockingwhenever the stored FQN differs fromoriginalFqn. It is a single prefix update over the entity and its subtree, limited to the task rows whoseaboutrelationship comes from the subtree's entity types. The workflow-instance repoint runs per subtree type. Recorded in ADR:2026-10-26-tasks-follow-fqn-changes-from-store-update.Type of change:
High-level design:
2.0.8/{mysql,postgres}/schemaChanges.sql, appended; 2.0.7 is released, 2.0.8 is not, and the fix ships in 2.0.x. A DB already on 2.1.0 still runs it: the runner reprocesses the latest executed version of the previous release train too — covered byContinuousMigrationIT). Probed in throwawaypostgres:15/mysql:8.3.0: Postgres alters the generated column in place and keeps all three indexes; both statements are idempotent; MySQL lookups keepref/rangeplans (key 771 vs 1027 bytes). Rollout note: on MySQL theMODIFYof a STORED generated column rebuildstask_entity(table copy).TaskDAO.repointAboutFqnHashSubtreereplacesupdateAboutFqnHashBatch:aboutFqnHash = old OR LIKE 'old.%'(served by the existing indexes), new hash = new prefix + remaining suffix,AND EXISTSonentity_relationship(toEntity='task',MENTIONED_IN,fromEntity IN (<types>)).MENTIONED_INinto a task is written only forabout(TaskRepository); comment mentions go tofield_relationship.EntityRepository.getFqnSubtreeEntityTypes()defaults to the entity's own type; Classification →{classification, tag}, Glossary →{glossary, glossaryTerm}. The entity's own tasks move on an exact hash match; onlygetNestedFqnEntityTypes()(domain→domain, tag→tag, glossary→glossaryTerm, glossaryTerm→glossaryTerm, classification→tag, container→container, page→page) move byhash.%prefix, in the same singleUPDATEso no row is rewritten twice. Metric, metric group and data product (bare-name FQNs) get the exact match only. The repoint runs only when the update stored the entity. Workflow-instance links are LIKE-escaped.updateTaskAboutFqnHashesand its calls inGlossaryRepository/GlossaryTermRepository(not used by Collate).updateWithDeferredStorepath (ingestion, no renames); reads byaboutEntitystill match without a type, so a list forXcan show another type'sXtasks (pre-existing, separate fix).Tests:
Use cases covered
aboutEntityXleaves the tasks of glossaryXand termX.Tin placeUnit tests
FeedDAOsandClassificationRepositoryare exercised throughTaskAboutFqnChangeIT.Backend integration tests
TaskAboutFqnChangeIT(8 tests),GlossaryTermResourceIT#test_createTaskAboutEighthLevelTerm,#test_moveTermWithTaskToEighthLevel_repointsTask,DomainResourceIT#test_createEighthLevelSubDomain.value too long for type character varying(256); 7 of the 8 repoint tests fail with the task missing from the new FQN.Tests run: 11, Failures: 0, Errors: 0(8 new + 3 width tests;[fqn-change] repointed taskslogged 9×); MySQL width tests 3/0/0.-DintegrationTests.lane=parallel, classes TaskAboutFqnChangeIT, GlossaryTermResourceIT, GlossaryResourceIT, GlossaryTermMoveApprovalIT, DomainResourceIT, TagResourceIT, ClassificationResourceIT, DataProductResourceIT, ContainerResourceIT, TaskResourceIT, EntityDeleteTaskCleanupIT, MetricResourceIT, ContinuousMigrationIT:Tests run: 2432, Failures: 0, Errors: 0, Skipped: 204Tests run: 649, Failures: 0, Errors: 0, Skipped: 49(the local run was cut off before the final BUILD line; the CI run below covers it)ContinuousMigrationITon both engines: 3/0/0 each.TaskAboutFqnChangeIT+ the 3 width tests +ContinuousMigrationIT— postgres-opensearchTests run: 14, Failures: 0, Errors: 0, mysql-elasticsearchTests run: 14, Failures: 0, Errors: 0.Ingestion integration tests
Playwright (UI) tests
Manual testing performed
GlossaryTermResourceIT#test_moveTermWithTaskToEighthLevel_repointsTask(same steps as the issue) on Postgres:value too longbefore the fix, move succeeds and the task follows after.postgres:15andmysql:8.3.0: widened column, kept indexes, ran it twice, inserted 263-char hashes, checkedEXPLAINplans.UI screen recording:
Not applicable — backend-only fix.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.1158772e7fagainstREVIEW.md— no 🔴. 🟡 open: no IT for the workflow-instance repoint on the newly covered types; no knowledge-page move / in-place term rename test; no upgrade-path migration test; INFO log on 0-row renames;aboutEntityreads still match without a type (pre-existing).🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues were found.Summary
Widens task and domain hash columns to 768 characters in the 2.0.8 migrations and moves task and workflow-link updates into the shared entity updater.
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[Update task hashes in one statement] D --> E[Match entity type and exact hash] D --> F[Match declared nested types and hash prefix] E --> G[Update workflow links once per type] F --> GReviews (6) · Last reviewed commit: "Move the hash-width migration to 2.0.8" · Reviewed by Greptile