Repository navigation
Add prepared statements functionality to ArrowFlight SQL server. - #103047
Conversation
|
Workflow [PR], commit [361ed00] Summary: ✅ AI ReviewSummaryThis PR adds prepared statement support for Arrow Flight SQL (create/bind/execute/close, limits, TTL, and integration tests), but there are still correctness gaps in prepared execution semantics. Verdict: request changes. Findings❌ Blockers
ClickHouse Rules
Final VerdictStatus: Minimum required actions:
|
…er_user server setting with default 100, add corresponding tests
…umber of arguments, support only one set of bindings per batch
Regression from ClickHouse#92141: server aborts with signal 6 during `loadDataPart` in debug and sanitizer builds when a part directory contains a leftover `txn_version.txt.tmp` file with no corresponding `txn_version.txt`. This state is produced by `VersionMetadataOnDisk::loadMetadata` case 2 (an incomplete write that was not atomically renamed). It returns a `VersionInfo` with `creation_tid = Tx::DummyTID` and `creation_csn = Tx::RolledBackCSN`. `Tx::DummyTID = {NonTransactionalCSN, DummyLocalTID, Nil} = {1, 2, Nil}` has `start_csn == NonTransactionalCSN` but `local_tid == DummyLocalTID` — which fails the invariant asserted in `TransactionID::isNonTransactional`. The new `VersionMetadata::validateInfo` (added by ClickHouse#92141) and `VersionInfo::wasInvolvedInTransaction` both call `isNonTransactional` on the loaded `creation_tid`, so the assertion aborts the server. Two changes: - `TransactionID::isNonTransactional`: widen the assertion to allow the `DummyTID` special case. The function still correctly returns `false` for `DummyTID` because `local_tid == DummyLocalTID != NonTransactionalLocalTID`. - `VersionMetadata::validateInfo`: early-return for rolled-back parts (`creation_csn == RolledBackCSN`). Such parts are marked `Outdated` immediately after loading by `MergeTreeData::loadDataPart` and cleaned up, so the live-part invariants validated here do not apply. CI reports showing the crash: - PR ClickHouse#103047: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=103047&sha=ec0124d77b94c97a4b1b48049b0215b1dddb94a5&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20distributed%20plan%2C%20s3%20storage%2C%20parallel%29 - PR ClickHouse#102961: same `Stateless tests (amd_debug, distributed plan, s3 storage, parallel)` check Regression test `04104_transaction_version_metadata_dummy_tid_load.sh` deterministically creates the scenario by dropping a bogus `txn_version.txt.tmp` into a part directory and running `DETACH` + `ATTACH`. Before the fix the server aborts with signal 6 at `TransactionID.h:90`; after the fix the rolled-back part is marked `Outdated` and invisible. Session: cron:clickhouse-ci-task-worker:20260418-221500
…etime_seconds=-1, set it default
|
@Diskein there is also a corresponding update for docs which I'm trying to keep relevant - it should help you to keep track of changes this PR brings: |
LLVM Coverage Report
Changed lines: 91.39% (435/476) · Uncovered code |
|
@Diskein could you please review - I think it's ready to merge |
Diskein
left a comment
There was a problem hiding this comment.
Looks good, just some remarks, follow-up questions and nitpicking 😄
| } | ||
|
|
||
| { | ||
| auto & by_exp = prep_statements.get<ByExpirationTime>(); |
There was a problem hiding this comment.
boost::multi_index really shines here! 🎉
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add prepared statements functionality to ArrowFlight SQL server.
closes #102886
Version info
26.5.1.587