Skip to content

Cherry pick #117404 to 26.7: Fix out of bound in timeSeriesGroupArray() - #118553

Merged
robot-ch-test-poll2 merged 6 commits into
backport/26.7/117404from
cherrypick/26.7/117404
Sep 24, 2026
Merged

robot-ch-test-poll2 merged 6 commits into
backport/26.7/117404from
cherrypick/26.7/117404

Conversation

@robot-clickhouse-ci-1

Copy link
Copy Markdown
Contributor

Original pull-request #117404

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

vitlibar and others added 5 commits September 1, 2026 20:35
The number of elements is read from the serialized state and was used for a single
allocation upfront, so a state claiming 2^60 or more elements made the size of the
allocation in bytes overflow and the following writes went past the allocated memory.
The array now grows while the data is read.
The count of samples in a bucket comes from the serialized state, so a small state could
ask for an arbitrarily large allocation. Only a bounded number of samples is reserved now
and the buffer grows while the samples are read.
The number of buckets is read from the serialized state and was only checked against
the bucket count derived from the function parameters. A huge window makes that count
enormous, so a tiny state could ask for an arbitrarily large allocation: an 18-byte
state of `timeSeriesChangesToGrid` allocated 1.25 GiB. Only a bounded number of buckets
is reserved now and the map grows while the buckets are read.
…es-grouparray

Fix out of bound in timeSeriesGroupArray()
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 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 Sep 7, 2026
@robot-clickhouse-ci-1

Copy link
Copy Markdown
Contributor Author

Dear @nikitamikhaylov, @vitlibar, this cherry-pick PR has not been updated for 3d0h2m50s. Please resolve the conflicts to backport #117404, or close this PR if the backport is no longer needed. This PR will be automatically closed after 7 days of inactivity.

@robot-ch-test-poll3

Copy link
Copy Markdown
Contributor

Dear @nikitamikhaylov, @vitlibar, this cherry-pick PR has not been updated for 7d0h2m25s. Closing automatically. If you still want to backport #117404, please resolve the conflicts and reopen this PR.

@robot-ch-test-poll3

Copy link
Copy Markdown
Contributor

Dear @nikitamikhaylov, @vitlibar, this PR is opened while #117404 was marked as backported. The pr-backports-created is removed, so the original PR can be processed again.

If the cherry-pick is not needed anymore, then just close this PR.

@nikitamikhaylov

Copy link
Copy Markdown
Member

@groeneai resolve the conflicts.

Merge the backport base while retaining the 26.7 hash map implementation of
`AggregateFunctionTimeseriesSamples`. Bound the initial sample reservation
to 4096 entries without importing the newer vector implementation.

Related: #118553
Related: #117404
@robot-ch-test-poll2
robot-ch-test-poll2 merged commit 65d4a9f into backport/26.7/117404 Sep 24, 2026
2 checks passed
@robot-ch-test-poll2
robot-ch-test-poll2 deleted the cherrypick/26.7/117404 branch September 24, 2026 09:32
@groeneai

Copy link
Copy Markdown
Collaborator

Your resolution landed before I got here, so nothing is left to do on this one.

For the rest of the wave: #117404 now reaches every supported branch. 26.9 has it from the branch cut, 26.8 via #118554, and the 26.3 and 26.7 cherry-picks merged this morning (#118551 and this PR) with backports #121928 and #121934 open. The only arm still missing it is 26.6, whose cherry-pick #118552 was auto-closed on 2026-09-17 while conflicting. SECURITY.md dropped 26.6 from the supported set on 2026-09-21 (d035660) and the last robot-created 26.6 backport was 2026-09-18, so I am leaving that one closed. Say so if you want 26.6 anyway and I will resolve it.

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.

6 participants