Conversation
JingsongLi
reviewed
Sep 20, 2026
JingsongLi
reviewed
Sep 20, 2026
JingsongLi
reviewed
Sep 20, 2026
JingsongLi
reviewed
Sep 20, 2026
JingsongLi
reviewed
Sep 20, 2026
JingsongLi
reviewed
Sep 20, 2026
JingsongLi
reviewed
Sep 20, 2026
Contributor
Author
|
Closing this PR because #891 has landed and addresses the original Python/process-runtime information_schema deadlock. The snapshot approach here adds a much broader metadata caching, freshness, DDL-coherence, and lifecycle subsystem that is no longer justified for the original incident. #891 does not claim to cover every caller-owned Tokio runtime topology; if that remaining boundary can be reproduced, it should be tracked separately with a focused regression test and a narrower fix. |
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.
Purpose
Refs #872. Supersedes #873 for the metadata-discovery path by fixing the catalog boundary instead of changing Tokio blocking behavior.
DataFusion's metadata discovery APIs are synchronous, while Paimon catalog and external table-engine resolution are asynchronous. Calling those async paths from
schema_names,schema,table_names, ortable_existcan block a DataFusion worker that the query itself needs, which is exposed by filteredinformation_schemaqueries with repartitioning.This PR intentionally does not close #872. Synchronous mutation callbacks (
register_schema,deregister_schema, andderegister_table) still use the existing blocking bridge; removing that bridge requires a separate lifecycle/API change.Brief change log
information_schemarefreshes with a freshness TTL, failure backoff, per-target single-flight, global concurrency limit, and timeout. A failed or timed-out catalog remains best-effort and cannot block healthy catalogs indefinitely.ALTER TABLE IF EXISTSuses a strict backend rename; a missing source succeeds without creating a phantom target and removes a stale-positive source from the snapshot.new(...)shims.try_new(...)is the initialized constructor;new_uninitialized(...)is the explicit deferred path used by Python construction.$snapshots; classification is bounded and cached so unchanged refreshes do not reload table metadata.Catalog::list_table_typeswith a Paimon-only compatibility default and exact bounded implementations for filesystem and REST catalogs.Ok(None)as not found intable(),table_exist(), andtable_type().PaimonCatalog; DataFusion registration initializes the provider andrefresh_metadata()remains an explicit strict refresh.Tests
cargo fmt --all -- --checkcargo clippy --locked -p paimon -p paimon-datafusion --all-targets -- -D warningscargo test -p paimon-datafusion --test sql_context_tests(94 passed)cargo test -p paimon-datafusion --test table_type_routing(41 passed)cargo test -p paimon-datafusion --lib 'sql_context::tests'(176 passed)cargo test -p paimon-datafusion --doc(2 passed, 3 ignored)cargo test -p paimon --test rest_catalog_test test_catalog_lists_declared_table_types(passed)PYO3_PYTHON=/opt/homebrew/bin/python3.11 cargo check --locked -p pypaimon_rust(passed)API and Format
PaimonCatalogProvider::newandPaimonSchemaProvider::neware removed because a synchronous constructor cannot preserve the previous ready discovery behavior without restoring the blocking bridge. Migrate initialized callers totry_new(...).await?; usenew_uninitialized(...)only when initialization is deliberately deferred and completeinitialize_metadata().await?before exposing discovery callbacks.Catalog::list_table_typesis a new defaulted method. Existing Paimon-only catalog implementations remain source compatible; catalogs containing object or external table types should override it.No storage format changes.
Documentation
Updated provider API documentation to describe the explicit initialized/deferred lifecycle and compile-check the removed synchronous constructor path.