Repository navigation
Conversation
|
Workflow [PR], commit [68f43cc] Summary: ✅
AI ReviewSummaryAdds a Silk fiber scheduler for cluster-mode Findings❌ Blockers
Tests
Missing context / blind spots
Final Verdict❌ Block. Preserve existing admission capacity, restore effective job timeout/logging settings, and address or substantiate the remaining connection-capacity and backlog-scaling concerns. Add focused regression coverage, including fiber shutdown. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 617/658 (93.77%) · Uncovered code |
| <clickhouse> | ||
| <allow_experimental_silk_runtime>true</allow_experimental_silk_runtime> | ||
| <silk> | ||
| <!-- Fiber stack size in bytes. The default (320 KiB) leaves enough room for OpenSSL handshakes. --> |
There was a problem hiding this comment.
this is insane! can we patch OpenSSL code maybe?..
…e a pointer swap Adopt the mechanism from #111275: each fetch step creates a ThreadStatus (the new `NoOSThreadTag` flavor - `thread_id = NO_OS_THREAD`, with `boundToOSThread` gates skipping the query profiler, taskstats counters and the group's OS-thread bookkeeping) and attaches it to the submitter's group once per step. The fiber-switch hooks reduce to a single `std::swap` of `current_thread` with the slot in the fiber's job header - measured 9.3 us -> 57 ns per switch - and they no longer construct or attach anything, which also removes the ThreadGroup mutex from the switch path. `ThreadStatus.{h,cpp}`, `ThreadStatusExt.cpp` and `ThreadGroupSwitcher.{h,cpp}` are adopted from #111275 nearly verbatim (four of the five post-images byte-identical) so the eventual merge resolves cleanly by taking upstream.
…e a pointer swap Adopt the mechanism from #111275: each fetch step creates a ThreadStatus (the new `NoOSThreadTag` flavor - `thread_id = NO_OS_THREAD`, with `boundToOSThread` gates skipping the query profiler, taskstats counters and the group's OS-thread bookkeeping) and attaches it to the submitter's group once per step. The fiber-switch hooks reduce to a single `std::swap` of `current_thread` with the slot in the fiber's job header - measured 9.3 us -> 57 ns per switch - and they no longer construct or attach anything, which also removes the ThreadGroup mutex from the switch path. `ThreadStatus.{h,cpp}`, `ThreadStatusExt.cpp` and `ThreadGroupSwitcher.{h,cpp}` are adopted from #111275 nearly verbatim (four of the five post-images byte-identical) so the eventual merge resolves cleanly by taking upstream. (cherry picked from commit c512b6b)
382ed37 to
a7a213e
Compare
|
Silk integration into the code base is continued in a separate PR: #112667 |
Co-Authored-By: Claude Fable 5.1 <[email protected]>
# Conflicts: # src/Storages/StorageQueryRunner.cpp
| enum class QueryRunnerScheduler : uint8_t | ||
| { | ||
| FIBERS, | ||
| THREADS, | ||
| }; |
There was a problem hiding this comment.
Can we make this more generic? I'd need something like this in backups
There was a problem hiding this comment.
I think WorkerKind works ok, wdyt?
| job_context->setUser(*job.origin->user_id, job.origin->external_roles, job.origin->authentication_grants, job.origin->authentication_valid_until); | ||
| } | ||
| if (job.origin->roles) | ||
| if (job.origin->user_id && job.origin->roles) |
There was a problem hiding this comment.
There's a very narrow edge case - I think it was flagged by AI code review at some point.
TLDR: with SQL SECURITY INVOKER and user_id = std::nullopt and roles = std::optional(std::vector<...>{}) (e.g. in startup scripts), we satisfy the original if and call setCurrentRoles, which throws a logical error.
| catch (...) | ||
| { | ||
| futures.pop_back(); |
There was a problem hiding this comment.
do we expect any other exceptions here? Does silk throw?
There was a problem hiding this comment.
Only CANNOT_SCHEDULE_TASK, Silk does not throw.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…nner Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
We can just run queries with |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Silk fibers can now be used in QueryRunner in cluster mode, which means that the ClickHouse server process does not occupy OS threads while waiting for remote clusters to execute QueryRunner's queries - which is important in workloads where QueryRunner has a lot of pending queries.
Workflow [PR]
Sync PR [sync-upstream/pr/111275]