Skip to content

Stable 24.8 Backport of #89127 - Fix TTL merge bug - #2883

Merged
zvonand merged 2 commits into
releases/24.8.14from
backports/releases/24.8.14/89127
Nov 19, 2026
Merged

zvonand merged 2 commits into
releases/24.8.14from
backports/releases/24.8.14/89127

Conversation

@blau-ai

@blau-ai blau-ai commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

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 to CHANGELOG.md):

Prevent TTL merge counter leaks when exceptions occur during merge preparation. Resolves ClickHouse#89019 (ClickHouse#89127 by @save-my-heart)

Documentation entry for user-facing changes

...

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

alesapin and others added 2 commits November 17, 2026 12:26
Fix TTL merge bug

Conflicts committed as-is; the next commit resolves them:
- src/Storages/StorageMergeTree.cpp (both modified)
Wrapped the tagger creation in try/catch that calls cancelMergeWithTTL, adapted to the 24.8 code shape.
@blau-ai

blau-ai commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

Port-AL: cherry-pick conflicts resolved by AI

Conflicted files:

  • src/Storages/StorageMergeTree.cpp (both modified)

Commits:

  • 0b8dcdb: cherry-pick with the conflicts committed as-is

  • 7b999a6: resolution

  • The conflict was in StorageMergeTree::selectPartsToMerge. Upstream changed a lambda that creates the tagger and the entry. In 24.8 that code is straight-line, ending in merging_tagger = ...; return ....

  • I kept the 24.8 structure (return {}, then bookMergeWithTTL() for TTL merges). I wrapped the CurrentlyMergingPartsTagger creation and the MergeMutateSelectedEntry return in try/catch (...).

  • The catch calls cancelMergeWithTTL() for TTL merge types and rethrows. This is the intent of PR Fix TTL merge bug ClickHouse/ClickHouse#89127: a throw during merge preparation no longer leaks the TTL merge counter.

  • I kept the 24.8 MergeTreeDataMergerMutator::estimateNeededDiskSpace call. CompactionStatistics doesn't exist in this branch. cancelMergeWithTTL already exists in MergeList.h.

@altinity-robot

altinity-robot commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

This is an automated comment for commit 7b999a6 with description of existing statuses. It's updated for the latest CI running

✅ Click here to open a full report in a separate page

Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Ready for releaseThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release aes_encryptionThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release aggregate_functions_1There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release aggregate_functions_2There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release aggregate_functions_3There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release alter_attach_1There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release alter_attach_2There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release alter_moveThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release alter_replaceThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release atomic_insertThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release base_58There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release benchmark_aws_s3There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release benchmark_gcsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release benchmark_minioThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release clickhouse_keeper_failoverThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release clickhouse_keeper_no_ssl_1There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release clickhouse_keeper_no_ssl_2There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release clickhouse_keeper_ssl_1There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release clickhouse_keeper_ssl_2There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release data_typesThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release datetime64_extended_rangeThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release disk_level_encryptionThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release dnsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release enginesThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release exampleThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release extended_precision_data_typesThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release functionsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release iceberg_1There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release iceberg_2There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release jwt_authenticationThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release kafkaThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release kerberosThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release key_valueThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release ldap_authenticationThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release ldap_external_user_directoryThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release ldap_role_mappingThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release lightweight_deleteThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release memoryThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release parquetThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release parquet_aws_s3There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release parquet_minioThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release part_moves_between_shardsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release rbac_1There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release rbac_2There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release rbac_3There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release s3_aws_s3_1There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release s3_aws_s3_2There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release s3_azure_1There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release s3_azure_2There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release s3_export_partThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release s3_export_partitionThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release s3_gcs_1There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release s3_gcs_2There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release s3_minio_1There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release s3_minio_2There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release s3_minio_3There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release selectsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release session_timezoneThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release settingsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release ssl_server_1There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release ssl_server_2There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release ssl_server_3There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release swarmsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release tiered_storage_localThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release tiered_storage_minioThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release tiered_storage_s3amazonThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release tiered_storage_s3gcsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release versionThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Regression release window_functionsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Sign releaseThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ success

@zvonand

zvonand commented Nov 18, 2026

Copy link
Copy Markdown
Member

@blau-ai

@blau-ai

blau-ai commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

CI triage for #2883 (head 7b999a6)

6 failing checks: 0 caused by the PR's code, 5 infra problems, 1 missing sign-off (DCO).
Every test suite that actually ran on the changed code passed. That includes the stateless, stateful and stress runs on ubsan, asan, msan, tsan and debug, plus the UBSan AST fuzzer itself, whose report says OK.

Check Classification Next step
BuilderDebAarch64 / Build-package_aarch64 Infra: runner lost Re-run failed jobs
Builds_Report Follows from the aarch64 build Clears after the re-run
ASTFuzzerUBsan / AST fuzzer (ubsan) Infra: GitHub API rate limit in post-run Re-run; fuzzer result is OK
RegressionTestsRelease / Common (swarms) Infra: docker-compose download returned HTML Re-run
RegressionTestsRelease / LDAP (authentication) Infra: same docker-compose problem Re-run
DCO No Signed-off-by lines See below. Not a code problem

1. Build-package_aarch64: infra

The job never got past "Set up job". Every later step has no conclusion, and the check-run annotation says:

The self-hosted runner lost communication with the server. Verify the machine is running and has a healthy network connection…

The compiler never ran, so this says nothing about the code.

2. Builds_Report: follows from #1

Builds … 1 of 7 builds are missing. 15/16 artifact groups are OK. The missing build is the aarch64 package. The aarch64 test jobs show as skipping because the PR body excludes aarch64 tests.

3. AST fuzzer (ubsan): infra in the CI harness

The fuzzer ran its full hour and ended normally. fatal.log is empty, the server stopped cleanly, and the uploaded report shows OK. The "Run" step succeeded with JOB_EXIT_CODE: 0. The failure is in the Post run step, where ci.py tried to set the commit status:

File ".../tests/ci/commit_status_helper.py", line 410, in get_repo
github.GithubException.RateLimitExceededException: 403 {"message": "API rate limit exceeded for user ID 74678562. ...
##[error]Process completed with exit code 1.
No CommitStatusData for [AST fuzzer (ubsan)], push dummy failure to ci_cache

The GitHub token's API quota ran out. This is not a ubsan finding.

4 and 5. Regression swarms and ldap_authentication: infra

Both jobs failed at the same moment (14:57), in about 50 ms, before any test ran. The docker-compose binary they downloaded turned out to be an HTML page:

/usr/local/bin/docker-compose: line 1: syntax error near unexpected token `newline'
/usr/local/bin/docker-compose: line 1: `<!DOCTYPE html>'
RuntimeError: could not read a version from `docker-compose --log-level ERROR version --short`
1 module (1 errored)

Most likely the docker-compose v2.23.1 release download from GitHub failed for a moment. All the other regression suites in the same run passed, including ldap_external_user_directory, ldap_role_mapping, parquet, rbac and s3.

6. DCO: missing sign-offs, not a code problem

Neither commit has a Signed-off-by line:

  • 0b8dcdb: the upstream merge commit (Merge pull request #89127…, author alesapin)
  • 7b999a6: the conflict-resolution commit (author blau-ai)

The DCO bot's own fix options are a remediation commit, or rewriting the branch with rebase --signoff plus a force-push. I'm not allowed to force-push, so if DCO must be green, a maintainer needs to choose one of these or override the check. That's normal practice for upstream backports. Nothing in the code needs to change.

Suggested action

  • Re-run the failed jobs in run 44083201413. That should clear checks 1–5. The ubsan fuzzer could also be accepted as-is, since its report is already OK.
  • Deal with DCO by policy as described above.
  • There's nothing to fix in src/Storages/StorageMergeTree.cpp, the only file this PR changes.

I didn't rebuild or re-run anything locally. This conclusion rests on the Actions job logs, check-run annotations and the S3 reports for this commit.

@zvonand zvonand added the verified Approved for release label Nov 19, 2026
@zvonand
zvonand merged commit 568c9c3 into releases/24.8.14 Nov 19, 2026
418 of 427 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants