Skip to content

Cherry pick #90770 to 25.11: Disable enable_shared_storage_snapshot_in_query (leads to memory leaks)#90800

Merged
robot-ch-test-poll1 merged 3 commits into
backport/25.11/90770from
cherrypick/25.11/90770
Nov 25, 2025
Merged

Cherry pick #90770 to 25.11: Disable enable_shared_storage_snapshot_in_query (leads to memory leaks)#90800
robot-ch-test-poll1 merged 3 commits into
backport/25.11/90770from
cherrypick/25.11/90770

Conversation

@robot-ch-test-poll1

Copy link
Copy Markdown
Contributor

Original pull-request #90770

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

azat added 2 commits November 24, 2025 22:19
Some functions stores a copy of `ContextPtr` (not a `weak_ptr` as it
should be, but `shared_ptr`), i.e. [`modulo`](https://github.com/ClickHouse/ClickHouse/blob/407e33a47cf707155d1c4f3f12d2bb2291c80009/src/Functions/FunctionBinaryArithmetic.h#L827),
but this `IFunction` itself can be stored in `KeyDescription`, which is
part of `StorageInMemoryMetadata`.

And with metadata cache (`enable_shared_storage_snapshot_in_query=1`)
this will create memory leaks (since this `Context` will never be
destroyed)

As @Michicosun has been told, this cache should never be part of
`Context` (but we abuse it often).

(Another issue is `IFunction` holds a `ContextPtr` not a
`ContextWeakPtr`, but this is another story)

Anyway, let's disable it for now (backported to 25.11 is a must).
…pshot_in_query

Disable enable_shared_storage_snapshot_in_query (leads to memory leaks)
@robot-ch-test-poll1 robot-ch-test-poll1 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default labels Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants