Repository navigation
Fixes #37316: key BigQuery DDL cache by FQN for concurrent dataset safety - #37333
Merged
Khairajani merged 3 commits intoNov 19, 2026
Conversation
Contributor
|
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! |
A 2048-entry per-table LRU dropped DDLs for datasets with more tables than the cap, and for concurrent datasets whose combined size exceeded it. Cache one dict per project.dataset instead, and re-fetch a dataset whose entry was evicted rather than reporting its tables' DDL as missing.
detail-app
Bot
force-pushed
the
detail/bug-fix/fixes-37316-key-bigquery-ddl-cache-by-fqn-for-conc-890f41
branch
from
November 18, 2026 15:30
f409bdb to
c3bb5dc
Compare
Each schema worker ingests one dataset at a time and reads each table's DDL once, so a thread-local slot holding its current dataset bounds memory to threads x one dataset, instead of up to 64 mostly-finished datasets in a shared LRU. A read for a dataset the thread does not hold fetches it.
Khairajani
approved these changes
Nov 19, 2026
harshsoni2024
approved these changes
Nov 19, 2026
Khairajani
deleted the
detail/bug-fix/fixes-37316-key-bigquery-ddl-cache-by-fqn-for-conc-890f41
branch
November 19, 2026 13:26
Khairajani
added a commit
that referenced
this pull request
Nov 20, 2026
…set safety (#37333) (#38234) Backport of #37333. Each schema worker thread holds only its current dataset's DDLs in a thread-local slot, so concurrent datasets no longer clear or overwrite each other's entries. (cherry picked from commit dbed533) Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com>
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.
Detail bug report: View on Detail
Describe your changes:
Fixes #37316
I worked on the BigQuery metadata ingestion DDL prefetch cache because
_table_ddl_cachewas a plaindictkeyed by bare table name and wiped withclear()at the start of every schema's prefetch. Whenthreads > 1, thedatabaseSchematopology node processes multiple datasets concurrently on one sharedBigquerySourceinstance, so a concurrent dataset's prefetch would clear/refill the shared cache — causing silent DDL loss (Nonereturned) or cross-dataset DDL contamination (a table'sschemaDefinitiondisplaying another dataset'sCREATE TABLE).This is the same concurrency pattern that was fixed for the sibling
_dataset_obj_cache/_table_obj_cachein #30974, but_table_ddl_cache(introduced earlier in #25471) was left untouched.Type of change:
High-level design:
threading.local()slot holding only that thread's current dataset (project.datasetkey +{table: ddl}).None.Tests:
Unit tests
test_bigquery.py: two real threads prefetching same-named tables concurrently each read their own DDL with no extra query (fails onmain); a 5000-table dataset keeps every DDL; a read for a dataset the thread doesn't hold fetches it; per-schema isolation, uncached table returnsNone, prefetch failure andincludeDDL=falsepaths.test_bigquery_sharding.py: fixture updated for the thread-local slot.Backend integration tests
Ingestion integration tests
includeDDL+threads > 1+ same-named tables across datasets, which is not covered by the existing integration test fixtures).Playwright (UI) tests
Manual testing performed
ingestion/tests/cli_e2e_v2/bigquery/test_metadata.py) but they could not execute — they require live GCP secrets (E2E_BQ_PRIVATE_KEY,E2E_BQ_PROJECT_ID,E2E_BQ_CLIENT_EMAIL, etc.) and a running OpenMetadata server, which are not available in this environment. The suite is designed to run viaworkflow_dispatchin CI with injected secrets.UI screen recording:
Not applicable — backend-only ingestion source change with no UI impact.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.docs/decisions/(see itsREADME.md). This description is gone fromgit logafter the squash-merge.Automatic Fixes PRs can be configured here.


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues were found.Summary
BigQuery ingestion now keeps table definitions separately for each worker, holding only its current dataset.
Previous discussion:
detail-app[bot]accepted whole-dataset memory use as a deliberate trade-off and left finer limits to maintainers.greptile-apps[bot]withdrew the earlier blocking cache finding.Reviews (8) · Last reviewed commit: "ingestion: hold BigQuery DDLs per schema..." · Reviewed by Greptile