Skip to content

Build mutations snapshot using parts visible in query#82945

Merged
Michicosun merged 3 commits intomasterfrom
fix_mutations_snapshot
Jul 4, 2025
Merged

Build mutations snapshot using parts visible in query#82945
Michicosun merged 3 commits intomasterfrom
fix_mutations_snapshot

Conversation

@Michicosun
Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

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

Now mutations snapshot will be built from the visible parts snapshot. Also mutation counters used in snapshot will be recalculated from the included mutations

@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Jun 30, 2025

Workflow [PR], commit [c53bdbf]

Summary:

@clickhouse-gh clickhouse-gh bot added the pr-improvement Pull request with some product improvements label Jun 30, 2025
@CurtizJ CurtizJ self-assigned this Jun 30, 2025
else if (!seen_all_data_mutations)
{
if (!status->is_done)
if (mutation_version > min_part_data_version)
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.

main fix is here, mutation can become finished after parts snapshot was taken and in this case it will not be visible during on-fly mutations apply phase.

@Michicosun Michicosun force-pushed the fix_mutations_snapshot branch from 7032eae to 2ca05f5 Compare June 30, 2025 17:51
@Michicosun Michicosun force-pushed the fix_mutations_snapshot branch from 2ca05f5 to 664da47 Compare June 30, 2025 17:52
if (!res->hasAnyMutations())
return res;
std::lock_guard lock(currently_processing_in_background_mutex);
if (!params.need_data_mutations && !params.need_alter_mutations && mutation_counters.num_metadata <= 0)
Copy link
Copy Markdown
Member Author

@Michicosun Michicosun Jun 30, 2025

Choose a reason for hiding this comment

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

It is probably better completely remove this, because even this check is not 100% accurate, because mutation_counters can be changed between acquisition of a snapshot of parts and mutations. And we can't use approach from rmt because for regular mt mutation entry does not contain alter version

UPD: It is ok to do this way, because mutations will be dropped from the current_mutations_by_version under the same lock

Copy link
Copy Markdown
Member

@CurtizJ CurtizJ left a comment

Choose a reason for hiding this comment

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

LGTM

@Michicosun Michicosun added this pull request to the merge queue Jul 4, 2025
Merged via the queue into master with commit 187cae9 Jul 4, 2025
121 checks passed
@Michicosun Michicosun deleted the fix_mutations_snapshot branch July 4, 2025 12:05
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 4, 2025
baibaichen pushed a commit to Kyligence/gluten that referenced this pull request Jul 5, 2025
baibaichen pushed a commit to apache/gluten that referenced this pull request Jul 6, 2025
* [GLUTEN-1632][CH]Daily Update Clickhouse Version (20250705)

* Fix benchmark build

* Fix Benchmark build due to ClickHouse/ClickHouse#79417

* Revert "Fix Build due to ClickHouse/ClickHouse#80931"

This reverts commit 02d12f6.

* Fix Build due to ClickHouse/ClickHouse#81886

* Fix Link issue due to ClickHouse/ClickHouse#83121

* Fix Build due to ClickHouse/ClickHouse#82604

* Fix Build due to ClickHouse/ClickHouse#82945

* Fix Build due to ClickHouse/ClickHouse#83214

---------

Co-authored-by: kyligence-git <[email protected]>
Co-authored-by: Chang chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements 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.

3 participants