Skip to content

Respect max_parts_to_merge_at_once in TTLPartDropMergeSelector#95315

Merged
kssenii merged 2 commits intomasterfrom
fix-ttl-merge-parts-limit
Jan 28, 2026
Merged

Respect max_parts_to_merge_at_once in TTLPartDropMergeSelector#95315
kssenii merged 2 commits intomasterfrom
fix-ttl-merge-parts-limit

Conversation

@kssenii
Copy link
Member

@kssenii kssenii commented Jan 27, 2026

Changelog category (leave one):

  • Improvement

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

Respect max_parts_to_merge_at_once in TTL drop part merges.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@clickhouse-gh
Copy link
Contributor

clickhouse-gh bot commented Jan 27, 2026

Workflow [PR], commit [de0519c]

Summary:

job_name test_name status info comment
Stress test (amd_tsan) failure
Logical error: Block structure mismatch in A stream: different number of columns: (STID: 0993-2da1) FAIL cidb, issue ISSUE EXISTS
Stress test (arm_asan, s3) failure
Segmentation fault (STID: 2704-3fd4) FAIL cidb, issue ISSUE CREATED
Integration tests (amd_asan, targeted) error IGNORED

@clickhouse-gh clickhouse-gh bot added the pr-improvement Pull request with some product improvements label Jan 27, 2026
@abashkeev abashkeev requested a review from Copilot January 27, 2026 19:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for respecting the max_parts_to_merge_at_once setting in TTL drop part merges, which previously only applied to regular merges but not TTL-based operations.

Changes:

  • Modified TTLPartDropMergeSelector to accept and enforce max_parts_to_merge_at_once limit
  • Updated merge selection logic to track and respect part count limits alongside existing memory and row constraints
  • Added integration test to verify the limit is properly enforced during TTL drop merges

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Storages/MergeTree/Compaction/MergeSelectors/TTLMergeSelector.h Added max_parts_to_merge_at_once parameter to constructors and border-finding methods
src/Storages/MergeTree/Compaction/MergeSelectors/TTLMergeSelector.cpp Implemented part count tracking and enforcement in merge range selection logic
src/Storages/MergeTree/Compaction/MergeSelectorApplier.cpp Passed max_parts_to_merge_at_once setting to TTLPartDropMergeSelector constructor
src/Interpreters/PartLog.cpp Updated documentation to include TTLDropMerge as a merge reason
tests/integration/test_ttl_replicated/test.py Added comprehensive test verifying part count limit enforcement in TTL drop merges

@Michicosun Michicosun self-assigned this Jan 27, 2026
@kssenii kssenii added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Jan 28, 2026
@kssenii kssenii added this pull request to the merge queue Jan 28, 2026
Merged via the queue into master with commit 6752222 Jan 28, 2026
130 of 134 checks passed
@kssenii kssenii deleted the fix-ttl-merge-parts-limit branch January 28, 2026 09:20
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jan 28, 2026
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Jan 28, 2026
robot-clickhouse-ci-2 added a commit that referenced this pull request Jan 28, 2026
Cherry pick #95315 to 25.12: Respect max_parts_to_merge_at_once in TTLPartDropMergeSelector
robot-clickhouse added a commit that referenced this pull request Jan 28, 2026
robot-clickhouse-ci-2 added a commit that referenced this pull request Jan 28, 2026
Cherry pick #95315 to 26.1: Respect max_parts_to_merge_at_once in TTLPartDropMergeSelector
robot-clickhouse added a commit that referenced this pull request Jan 28, 2026
clickhouse-gh bot added a commit that referenced this pull request Jan 28, 2026
Backport #95315 to 25.12: Respect max_parts_to_merge_at_once in TTLPartDropMergeSelector
clickhouse-gh bot added a commit that referenced this pull request Jan 28, 2026
Backport #95315 to 26.1: Respect max_parts_to_merge_at_once in TTLPartDropMergeSelector
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-improvement Pull request with some product improvements pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR 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.

5 participants