Repository navigation
Propagate the internal flag to secondary queries - #108506
Conversation
|
Workflow [PR], commit [2176e7c] Summary: ❌
AI ReviewSummaryThis PR adds an Findings
Final VerdictChanges requested. The wire-format and local logging split are in place, but internal secondary-query logging is still incomplete for direct interpreter paths and distributed-plan fragments. |
|
How does a server ensure that a client sends correct |
|
In the code |
I have not found a clean way to verify if So, I suggest that for remote internal queries, we just log them as internal (required for autoscaling: https://github.com/ClickHouse/support-escalation/issues/8036), but continue to treat them as normal (e.g. no bypassing |
Updated the doc. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
The makeFullClientInfoWire helper hand-crafts a complete ClientInfo wire payload, but was not updated for the new trailing is_internal field read at protocol revision >= 54486, so ClientInfo::read hit an exhausted buffer and threw "Cannot read all data" in the two tests using it. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108506&sha=4b048ccec9031d7fd1fb5a0cb1f74de703509a9a&name_0=PR&name_1=Unit+tests+%28amd_llvm_coverage%29 PR: #108506 Co-Authored-By: Claude Fable 5 <[email protected]>
…into log-internal-secondary-queries
|
Updating the branch to fix the |
…into log-internal-secondary-queries
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 148/149 (99.33%) · Uncovered code |
Resolved conflicts in the query-logging path where master (ClickHouse#108506, "Propagate internal flag to secondary queries") added a `log_as_internal` parameter to `logQueryStart` / `logExceptionBeforeStart` while this branch added `applied_rewrite_rules` / `ast_for_formatted_query`. Both additions are orthogonal, so the resolution keeps both: the signatures now take `internal, log_as_internal, ..., applied_rewrite_rules[, ast_for_formatted_query]` and every call site (executeQuery.cpp, AsynchronousInsertQueue.cpp, RefreshTask.cpp, StorageMaterializedView.cpp) passes both, preserving master's `log_as_internal` values (`is_internal` for the async-insert / refresh helpers).
…cation Resolve a conflict in `src/Storages/MaterializedView/RefreshTask.cpp`: master's `log-internal-secondary-queries` work (#108506) added a `log_as_internal` parameter to `logQueryFinish`, while this branch prepended the `IF CHANGED` post-read source-hash recompute block before that call. Kept both: the source-hash recompute stays, and the `logQueryFinish` call uses master's updated signature with `/*log_as_internal=*/internal`. All feature translation units touched by master's churn (`executeQuery.cpp`, `Planner.cpp`, `ReadFromObjectStorageStep.cpp`, `StorageObjectStorage.cpp`, `StorageDistributed.cpp`, `MergeTreeData.cpp`, `StorageMerge.cpp`, `StorageSystemTables.cpp`, `Context.cpp`, `RefreshTask.cpp`) verified to compile (`-fsyntax-only`) against the merged headers.
The makeFullClientInfoWire helper hand-crafts a complete ClientInfo wire payload, but was not updated for the new trailing is_internal field read at protocol revision >= 54486, so ClientInfo::read hit an exhausted buffer and threw "Cannot read all data" in the two tests using it. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108506&sha=4b048ccec9031d7fd1fb5a0cb1f74de703509a9a&name_0=PR&name_1=Unit+tests+%28amd_llvm_coverage%29 PR: ClickHouse#108506 Co-Authored-By: Claude Fable 5 <[email protected]>
…ondary-queries Propagate the internal flag to secondary queries
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Secondary queries executed as part of internal queries will now be logged as internal queries.