Fixes #29493: expand entity_extension.extension from VARCHAR(256) to VARCHAR(512)#29496
Fixes #29493: expand entity_extension.extension from VARCHAR(256) to VARCHAR(512)#29496ivnvMkhl wants to merge 4 commits into
Conversation
❌ 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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Thanks for your contribution @ivnvMkhl. This won't solve the underlying issue. It simply move the bound higher up. If we are seeing this kind of error in production let's solve the root cause |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
1 similar comment
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
…CHAR(256) to VARCHAR(512) FullyQualifiedName.buildHash joins one MD5 hash (32 chars) per FQN segment with dots. Tables with 8+ levels of nested columns produce keys of 263+ chars (8*32 + 7 dots), exceeding the VARCHAR(256) limit and causing a DB error. VARCHAR(512) safely covers up to 15 nesting levels. Migration added for both PostgreSQL and MySQL; bootstrap schemas updated to match.
b52eba9 to
0ff9b5b
Compare
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
🔴 Playwright Results — 4 pipeline/setup failure(s)✅ 0 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped Pipeline and setup failures
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
Thanks for the quick feedback, @TeddyCr — fair concern, and I looked into it before writing the width bump. Why This repo already has precedent for handling this the way I proposed. When FQN-hash columns were introduced in 1.1.0, most of them were sized well above 256 for exactly this reason: -- 1.1.0/postgres/schemaChanges.sql
ALTER TABLE tag_usage ADD COLUMN tagFQNHash VARCHAR(382), ADD COLUMN targetFQNHash VARCHAR(382);
ALTER TABLE field_relationship ADD COLUMN fromFQNHash VARCHAR(382), ADD COLUMN toFQNHash VARCHAR(382);
ALTER TABLE web_analytic_event ... ADD COLUMN fqnHash VARCHAR(768);
Given that, I'd suggest: merge the width bump now (zero migration risk, brings this column in line with its siblings, unblocks the overflow users are hitting today), and I'm happy to open a separate issue to scope a real redesign of |
|
@ivnvMkhl lets add the change 2.0.0 migrations not 2.0.3 |
Per review feedback (harshach): 2.0.0 is still the current unreleased migration version on main, so this change belongs there instead of introducing a new 2.0.3 version folder.
|
@harshach Moved the schema change into the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Per gitar-bot review: the prior comment stated a MySQL-specific restriction (TEXT cannot be a PK component without a prefix index) as if it applied to Postgres, which has no such restriction. Reworded to clarify the real reason VARCHAR(512) is used here: parity with the MySQL migration, not a Postgres limitation.
|
@gitar-bot Good catch — reworded the comment (pushed 45d26a3). It now states the real reason VARCHAR(512) is used here: Postgres itself has no restriction on TEXT in a btree primary key, but the column is kept as VARCHAR(512) to stay identical to the MySQL migration, where TEXT can't be a PK component without a prefix index. |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ Approved 1 resolved / 1 findingsExpands the ✅ 1 resolved✅ Quality: MySQL-specific comment copied into Postgres migration
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
Description of Changes
Fixes #29493
FullyQualifiedName.buildHashbuilds the extension key by MD5-hashing each FQN segment and joining with dots. For deeply nested columns (8+ levels) this produces keys longer than 256 chars (8 segments × 32 chars + 7 dots = 263), exceeding theentity_extension.extensioncolumn limit and causing a DB error:This PR expands the column to
VARCHAR(512), which safely covers up to 15 nesting levels (15×32 + 14 = 494 chars).Changes:
2.0.3for PostgreSQL and MySQLpostgres.sql,mysql.sql) updated to matchType of Change
High-level Design
N/A — schema-only change, no logic changes.
Testing Coverage
UI Evidence
Not applicable.
Checklist
Fixes #<issue>: <description>formatSummary by Gitar
entity_extension.extensioncolumn expansion from a standalone 2.0.3 migration into the existing 2.0.0schemaChanges.sqlfiles for both MySQL and PostgreSQL.This will update automatically on new commits.
Greptile Summary
This PR expands the
entity_extension.extensioncolumn fromVARCHAR(256)toVARCHAR(512)in both MySQL and PostgreSQL to fix an overflow caused by deeply nested struct columns.FullyQualifiedName.buildHashproduces MD5-hash-per-segment keys, and 8+ nesting levels exceed 256 characters.2.0.0migrationschemaChanges.sqlfor both databases, consistent with the team's pattern of consolidating pre-release migrations (2.0.1 was previously merged into 2.0.0 via chore(migrations): move 2.0.1 migrations into 2.0.0 #29391).mysql.sql,postgres.sql) are updated to match, keeping fresh installs consistent with migrated ones.Confidence Score: 5/5
Safe to merge — schema-only change expanding a column width with no logic alterations.
The change is narrowly scoped: four files, all touching the same column definition. Both the migration and the bootstrap schema are updated consistently. The MySQL migration correctly preserves charset (ascii_bin) and NOT NULL. The PostgreSQL ALTER COLUMN TYPE form preserves the NOT NULL constraint implicitly. The combined PK byte footprint (36 + 512 = 548 bytes ASCII) is well within InnoDB's 3072-byte index limit. Placing the fix in the 2.0.0 migration is consistent with this repo's established pattern of consolidating pre-release migrations.
No files require special attention.
Important Files Changed
Reviews (6): Last reviewed commit: "Rewords Postgres migration comment to be..." | Re-trigger Greptile