feat(q): log every request in the core's query log - #12
Merged
Merged
Conversation
- the q wire server evaluated a request without a trace of what it cost the poll thread, while the native IPC server records one row per query in `.sys.querylog`; a query queued behind a push had no number to blame - bracket decode and evaluation with the core's ray_qlog_begin/end, so a request lands as a row with duration and status once the log is on - a list request, the shape a publisher pushes, is logged as its head and the frame's size; formatting a pushed table back to source would cost more than the push
Collaborator
|
Reviewed and merged (f5cf1b5). Thanks, this is a real gap: the q wire was the only entry point that left no trace in No CI ran on this PR (first-contribution gate), so it was run locally instead: core master Review
The |
Collaborator
|
Reverted on master in 92e0d91 ( |
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.
How it looks from the user's side
With the core's query log on, a request that arrives over the q wire now leaves a row in
.sys.querylog, as a native IPC request already does:Before -- the q wire server never writes to the log, so the ring stays empty (
test/rfl/server/querylog.rflagainst a server built frommaster):After -- one row per evaluated request, with its duration (decode included), status and source:
Why
The q wire server evaluates every request on the poll thread, beside everything else the runtime does. When a query waited seconds, nothing said which request held the thread: the native IPC server records one row per query in
.sys.querylog, and the q wire server recorded none. A publisher's pushes ((upd; table)`) are exactly the requests a query queues behind.What changed
q_read_bodybrackets decode and evaluation with the core'sray_qlog_begin/ray_qlog_end, so each request is one row once.sys.querylog.enableis on. With the log off,ray_qlog_beginis one relaxed load and the source is never formatted.RAY_QLOG_QUERY_MAX(256 bytes). A list request, the shape a publisher pushes, is logged as its head and the frame's size,(upd ...) 132 B: formatting a pushed table back to source would cost more than evaluating it.q_conn_send, not a query, and is not logged.test/rfl/server/querylog.rflcovers a sum, a parse error, the duration and a list request.q_server.handdocs/CHANGELOG.md(Unreleased, Added) describe the same behaviour.Overlap with open PRs
Merges cleanly with #10. Conflicts with #8 on one line: both add an
#includeright aftercore/sock.h(core/timer.hthere,core/qlog.hhere), and keeping both resolves it.Tests