Repository navigation
Introduce the QueryRunner table engine - #107888
Conversation
|
Workflow [PR], commit [0df265d] Summary: ❌
AI ReviewSummaryThis PR introduces the Findings❌ Blockers
Final Verdict
|
Resolved conflicts: - src/Server/TCPHandler.cpp: kept the branch's discard_query_result gate; dropped the obsolete allow_experimental_query_deduplication / sendPartUUIDs block that master removed. - src/Storages/StorageView.cpp, src/Storages/StorageMaterializedView.cpp: kept the branch's DefinerDependencies rename over master's local metadata variable refactor in drop(). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
@groeneai, please confirm that none of the CI failures is due to this PR's changes. I've checked myself, but I need 100% confidence. |
|
@mstetsyuk Confirmed: none of the failing checks at HEAD ( There are two distinct real failures, both pre-existing trunk issues: 1. 2.
Your own new tests pass at HEAD across all builds: |
|
Hi @mstetsyuk — a couple of suggestions to make this PR easier for reviewers and the changelog reader. Description (currently
Ignore this if the current title/body is intentional. |
Introduce the `QueryRunner` table engine
…tions With `async_socket_for_remote = 0`, `RemoteQueryExecutor::read` releases `was_cancelled_mutex` before `connections->receivePacket()` (since 58718f2 in ClickHouse#107888, which fixed a livelock on detach). When `LIMIT` closes the port, `RemoteSource::onUpdatePorts` calls `finish()` on another executor thread, and its drain loop reads `hasActiveConnections()` without a lock while the reader's `receivePacket()` decrements `active_connection_count` on `EndOfStream` under `cancel_mutex` only. TSan reports it as STID 4761-4859 (Stress test (amd_tsan)). The comment that justified the lock-free accessor ("sendCancel() does not change the state of the replicas") did not cover this writer. `HedgedConnections` has the same accessor and the same writer (`finishProcessReplica`). Make the top-level counter `std::atomic<size_t>` in both classes. This only makes the existing lock-free read defined: no value changes, because the counter just guards the drain loop and the next `receivePacket()` re-checks it under `cancel_mutex` and returns `EndOfStream` once the query is cancelled. `HedgedConnections::OffsetState::active_connection_count` stays a plain `size_t`: it is never read by `hasActiveConnections()`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Introduce the
QueryRunnertable engine. Records inserted into aQueryRunnertable represent queries that the engine executes. The engine can be used for asynchronous query execution, batch execution of generated queries, directing queries to remote clusters, benchmarks, fuzzing, and testing with shadow traffic.