[codex] Avoid explicit metadata transactions for snapshot reads - #20
Draft
bill-ph wants to merge 1 commit into
Draft
[codex] Avoid explicit metadata transactions for snapshot reads#20bill-ph wants to merge 1 commit into
bill-ph wants to merge 1 commit into
Conversation
bill-ph
force-pushed
the
codex/snapshot-query-no-long-metadata-tx
branch
from
May 19, 2026 20:19
8b769eb to
05ee7bf
Compare
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.
Summary
Phase 4 of the metadata snapshot-read plan: normal snapshot-safe reads now avoid DuckLake's explicit long-lived metadata transaction path.
This keeps explicit DuckLake metadata transactions for write/current/maintenance paths while routing normal
SnapshotQueryreads through a no-explicit-transaction metadata connection. Postgres-backed snapshot reads still go throughpostgres_query, so postgres-scanner may continue creating its own implicit read transaction underneath; that remains Phase 5 scope.Changes
SnapshotQuerycan run withoutBeginTransaction()whileExecute,CurrentQuery, andRawQuerykeep the explicit transaction path.SnapshotQueryInTransactionfor maintenance/commit paths that still require explicit metadata transaction behavior.metadata_apiandducklake_explicit_metadata_transactionso tests can assert the boundary directly.Validation
git diff --checkpython3 scripts/check_metadata_query_intent.pycmake --build build/release --target unittest -j 8cmake --build build/release --target duckdb -j 8cmake --build build/release --target ducklake_loadable_extension -j 8./build/release/test/unittest --test-dir ./ test/sql/metadata/snapshot_reads_no_ducklake_tx.test./build/release/test/unittest --test-dir ./ test/sql/metadata/inlined_snapshot_reads_no_ducklake_tx.test./build/release/test/unittest --test-dir ./ test/sql/metadata/maintenance_snapshot_reads_keep_ducklake_tx.test./build/release/test/unittest --test-dir ./ test/sql/metadata/snapshot_reads_stay_pinned_after_commits.test./build/release/test/unittest --test-dir ./ test/sql/general/ducklake_metadata_logging.testPGHOST=127.0.0.1 PGUSER=postgres DUCKLAKE_CI=1 ./build/release/test/unittest --test-config test/configs/postgres.json --test-dir ./ test/sql/metadata/postgres_snapshot_reads_no_ducklake_tx.test