Skip to content

Set query_id in system.trace_log for dictionary auto-reloads - #98784

Merged
mstetsyuk merged 2 commits into
masterfrom
set-system-trace-log-query-id-for-dictionary-auto-reloads
Mar 5, 2026
Merged

mstetsyuk merged 2 commits into
masterfrom
set-system-trace-log-query-id-for-dictionary-auto-reloads

Conversation

@mstetsyuk

@mstetsyuk mstetsyuk commented Mar 4, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Make system.trace_log entries for ClickHouse dictionaries' auto-reloads have non-empty query IDs.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Note

Low Risk
Low risk: change only reorders when setCurrentQueryId({}) is applied for local dictionary queries to improve logging/tracing, with added test coverage.

Overview
Ensures local ClickHouseDictionarySource executions set context_copy->setCurrentQueryId({}) before creating CurrentThread::QueryScope, so internal dictionary reload queries produce non-empty query_id values usable by system.trace_log.

Extends 03701_dictionary_logging_internal_queries to also assert that profiler (trace_log) entries from dictionary auto-reloads have a query_id matching the corresponding internal system.query_log records, and marks the test with tags to skip sanitizer/debug runners.

Written by Cursor Bugbot for commit e363fd2. This will update automatically on new commits. Configure here.

Version info

  • Merged into: 26.3.1.449

@mstetsyuk
mstetsyuk marked this pull request as draft March 4, 2026 20:09
@clickhouse-gh

clickhouse-gh Bot commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e363fd2]

Summary: ✅

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Mar 4, 2026
@mstetsyuk
mstetsyuk marked this pull request as ready for review March 5, 2026 18:33
@mstetsyuk
mstetsyuk added this pull request to the merge queue Mar 5, 2026
Merged via the queue into master with commit b5ba49e Mar 5, 2026
146 checks passed
@mstetsyuk
mstetsyuk deleted the set-system-trace-log-query-id-for-dictionary-auto-reloads branch March 5, 2026 21:43
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Mar 5, 2026
@mstetsyuk

Copy link
Copy Markdown
Member Author

flaky test fix: #98910

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants