Skip to content

Extend trace_log with memory_context and memory_blocked_context for ClickHouse debugging - #87765

Merged
azat merged 1 commit into
ClickHouse:masterfrom
azat:trace_log-memory-context
Sep 29, 2025
Merged

azat merged 1 commit into
ClickHouse:masterfrom
azat:trace_log-memory-context

Conversation

@azat

@azat azat commented Sep 27, 2025

Copy link
Copy Markdown
Member

The following new columns has been added to trace_log:

  • memory_context is one of Global/User/Process/Thread
  • memory_blocked_context does the memory tracker blocked with MemoryTrackerBlockerInThread

This additional information is useful to track memory bugs, for instance to investigate drift for query memory usage we need to known was this allocation respected for the query or not (memory_blocked_context = 'Max' - means that it was respected).

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Extend trace_log with memory_context and memory_blocked_context for ClickHouse debugging

@clickhouse-gh

clickhouse-gh Bot commented Sep 27, 2025 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1c7134a]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_ubsan, parallel) failure
00984_parser_stack_overflow FAIL
02177_issue_31009 FAIL
00159_parallel_formatting_csv_and_friends FAIL
Stateless tests (amd_debug, distributed plan, s3 storage, sequential) failure
01459_manual_write_to_replicas_quorum_detach_attach FAIL
Stress test (amd_debug) failure
Server died FAIL
Hung check failed, possible deadlock found (see hung_check.log) FAIL
Killed by signal (in clickhouse-server.log) FAIL
Fatal message in clickhouse-server.log (see fatal_messages.txt) FAIL
Killed by signal (output files) FAIL
Found signal in gdb.log FAIL
Upgrade check (amd_debug) failure
Killed by signal (in clickhouse-server.log) FAIL
Fatal message in clickhouse-server.log (see fatal_messages.txt) FAIL
Killed by signal (output files) FAIL
Found signal in gdb.log FAIL

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Sep 27, 2025
@azat

azat commented Sep 27, 2025

Copy link
Copy Markdown
Member Author
E               Exception: Command [docker compose --env-file /ClickHouse/tests/integration/test_trace_log_memory_context/_instances-0-gw0/.env --project-name roottesttracelogmemorycontext-gw0 --file /ClickHouse/tests/integration/test_trace_log_memory_context/_instances-0-gw0/node/docker-compose.yml pull] return non-zero code 18:  node Pulling 
E                node Error Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
E               Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

@azat
azat force-pushed the trace_log-memory-context branch from 5b585ec to b965878 Compare September 27, 2025 21:19

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexey-milovidov alexey-milovidov self-assigned this Sep 28, 2025
…lickHouse debugging

The following new columns has been added to trace_log:
- memory_context is one of Global/User/Process/Thread
- memory_blocked_context does the memory tracker blocked with MemoryTrackerBlockerInThread

This additional information is useful to track memory bugs, for instance
to investigate drift for query memory usage we need to known was this
allocation respected for the query or not (memory_blocked_context =
'Max' - means that it was respected).

v2: less flaky test
@azat
azat force-pushed the trace_log-memory-context branch from b965878 to 1c7134a Compare September 28, 2025 13:19
@azat

azat commented Sep 29, 2025

Copy link
Copy Markdown
Member Author

@azat
azat enabled auto-merge September 29, 2025 10:03
@azat
azat added this pull request to the merge queue Sep 29, 2025
Merged via the queue into ClickHouse:master with commit ea5dcea Sep 29, 2025
@azat
azat deleted the trace_log-memory-context branch September 29, 2025 10:16
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog 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