Skip to content

Introduce OPTIMIZE DRY RUN query for emulating a merge - #96122

Merged
CurtizJ merged 12 commits into
ClickHouse:masterfrom
CurtizJ:optimize-dry-run
Feb 19, 2026
Merged

CurtizJ merged 12 commits into
ClickHouse:masterfrom
CurtizJ:optimize-dry-run

Conversation

@CurtizJ

@CurtizJ CurtizJ commented Feb 5, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • New Feature

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

Added OPTIMIZE <table> DRY RUN PARTS <part names> query to simulate merges without committing the result part. It may be useful for testing purposes: verifying merge correctness in the new version, deterministically reproducing merge-related bugs, and reliably benchmarking merge performance.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.2.1.952

@clickhouse-gh

clickhouse-gh Bot commented Feb 5, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d4bdc6e]

Summary: ❌

job_name test_name status info comment
BuzzHouse (amd_tsan) failure
Received signal -1 (STID: 3563-4712) FAIL cidb, issue ISSUE CREATED

@clickhouse-gh clickhouse-gh Bot added the pr-feature Pull request with new product feature label Feb 5, 2026
@UnamedRus

Copy link
Copy Markdown
Contributor

without committing the result part

Will merge with writing result part to /detached directory have any use cases?

@CurtizJ
CurtizJ marked this pull request as ready for review February 11, 2026 13:08
@CurtizJ

CurtizJ commented Feb 11, 2026

Copy link
Copy Markdown
Member Author

Will merge with writing result part to /detached directory have any use cases?

Maybe it makes sense to move part to detached in case of failure to allow investigation of data.

@Michicosun Michicosun self-assigned this Feb 11, 2026
@CurtizJ
CurtizJ requested a review from Michicosun February 16, 2026 11:02

@Michicosun Michicosun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wdyt not add an additional merge selector that will be populated with merge variants through this type of query? It will allow us to write deterministic tests about MergerMutator.

/// Delete 'is_deleted' data
bool cleanup = false;
/// Dry run mode: execute merge but do not commit the result
bool dry_run = false;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It also makes sense to introduce a regular optimize query with a parts list that will actually commit the merged part. This will allow us to validate merge predicate bugs.

@CurtizJ CurtizJ Feb 19, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We decided to implement regular OPTIMIZE with a parts list that triggers a special manual merge selector in a future PR. The feature will be guarded by a setting and intended primarily for testing, since manual merges that commit the result part are unsafe for production use.

@CurtizJ
CurtizJ added this pull request to the merge queue Feb 19, 2026
Merged via the queue into ClickHouse:master with commit 1818bc6 Feb 19, 2026
142 of 143 checks passed
@CurtizJ
CurtizJ deleted the optimize-dry-run branch February 19, 2026 23:12
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 19, 2026
@rschu1ze

Copy link
Copy Markdown
Member

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

Labels

pr-feature Pull request with new product feature 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