Skip to content

Backport #113877 to 26.3: Fix out-of-bounds write on a long codec chain - #126726

Merged
rschu1ze merged 1 commit into
26.3from
backport/26.3/113877
Oct 19, 2026
Merged

rschu1ze merged 1 commit into
26.3from
backport/26.3/113877

Conversation

@robot-clickhouse

@robot-clickhouse robot-clickhouse commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Original pull-request #113877
Cherry-pick pull-request #126673

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.3.57.6

@robot-clickhouse robot-clickhouse added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default labels Oct 19, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [e640778]

Summary: ✅

@groeneai

Copy link
Copy Markdown
Collaborator

On 26.3 this backport stops a table from loading if its stored TTL RECOMPRESS CODEC has more than 255 codecs or a chain whose reserved size overflows. 26.3 still runs the codec sanity checks for a TTL recompression codec on ATTACH, and the new checks are sanity checks. 26.7 and master skip them on ATTACH (e10d76d).

Measured on a 26.3 debug build: tables with TTL d + INTERVAL 1 DAY RECOMPRESS CODEC(Delta x300, ZSTD) and RECOMPRESS CODEC(FPC x150), created on 26.3 without this backport, fail to attach on server start with this branch (Code: 36 ... Too many codecs in the codec chain: 301), and a query on system.tables then fails with ASYNC_LOAD_WAIT_FAILED. With the commit below both tables load, CREATE and ALTER ... MODIFY TTL still reject those chains, and 04812_codec_chain_reserve_overflow passes.

The commit adds !is_attach && to the sanity-check argument in TTLDescription.cpp (only that half of e10d76d), on top of this branch:

git fetch https://github.com/groeneai/ClickHouse backport-26.3-113877-ttl-attach && git push origin FETCH_HEAD:backport/26.3/113877

@rschu1ze
rschu1ze merged commit c09fcae into 26.3 Oct 19, 2026
36 checks passed
@rschu1ze
rschu1ze deleted the backport/26.3/113877 branch October 19, 2026 19:41
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 This PR was merged before the follow-up was applied. I opened #127150 against 26.3 with @groeneai's commit, which skips the codec sanity checks for a TTL RECOMPRESS CODEC on ATTACH, so tables that already exist keep loading.

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

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants