Skip to content

Resubmit 'Skip back up of refreshable materialized view targets' #93076 - #93658

Merged
jkartseva merged 10 commits into
ClickHouse:masterfrom
jkartseva:resubmit-93076
Jan 14, 2026
Merged

jkartseva merged 10 commits into
ClickHouse:masterfrom
jkartseva:resubmit-93076

Conversation

@jkartseva

@jkartseva jkartseva commented Jan 8, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

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

Introduced backup_data_from_refreshable_materialized_view_targets backup setting to control whether to back up data of refreshable materialized views. Targets of RMVs with APPEND refresh strategy are always backed up.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.1.1.494
  • Backported to: 25.12.4.23, 25.11.7.38, 25.10.5.37

@clickhouse-gh

clickhouse-gh Bot commented Jan 8, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [07d363e]

Summary: ❌

job_name test_name status info comment
Integration tests (amd_asan, targeted) error

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Jan 8, 2026
Comment thread src/Backups/BackupEntriesCollector.cpp Resolved
Comment thread src/Backups/BackupSettings.h Resolved
res_table_info.create_table_query = create_table_query;
res_table_info.metadata_path_in_backup = metadata_path_in_backup;
res_table_info.data_path_in_backup = data_path_in_backup;
res_table_info.should_backup_data = shouldBackupTableData(qualified_name, storage);

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.

should_backup_data means almost the opposite of backup_settings.structure_only, so I suggest checking backup_settings.structure_only in shouldBackupTableData() and then checking only res_table_info.should_backup_data where it's possible.

Comment thread src/Backups/BackupEntriesCollector.cpp Resolved
Comment thread src/Backups/BackupEntriesCollector.cpp Outdated
return mv && mv->isRefreshable() && !append && mv->getTargetTable() == target;
};
if (!dependents.empty()
&& std::all_of(

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.

Shouldn't it be std::any_of?

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.

I've been debating myself about this. I can't think of an example where a mixture of RVM w/ replace strategy and regular MV or RVM w/ append strategy is used. std::any_of is also fine, I think.

introduce isTargetForReplaceRefreshableMaterializedView to backup utils
document
@jkartseva
jkartseva requested a review from vitlibar January 10, 2026 04:27
@vitlibar

Copy link
Copy Markdown
Member

@jkartseva Please take a look at #93553

@jkartseva

Copy link
Copy Markdown
Member Author

I replied in the issue.

Comment thread src/Backups/BackupEntriesCollector.cpp Resolved
/// replace the table on each refresh (without APPEND), as they contain
/// transient data that can be recomputed. Targets with APPEND or regular
/// materialized views are always backed up because they may store history.
bool backup_data_from_refreshable_materialized_view_targets = 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.

Are there any cases where it makes sense to set it to true?

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.

I can't think of any, I made this setting for compatibility in case customers complain that they need an additional REFRESH and WAIT view after the backup is completed.

@jkartseva

Copy link
Copy Markdown
Member Author

@jkartseva
jkartseva enabled auto-merge January 14, 2026 03:40
@jkartseva
jkartseva added this pull request to the merge queue Jan 14, 2026
Merged via the queue into ClickHouse:master with commit 6f9b4b2 Jan 14, 2026
250 of 256 checks passed
@jkartseva
jkartseva deleted the resubmit-93076 branch January 14, 2026 05:15
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jan 14, 2026
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Jan 16, 2026
robot-clickhouse added a commit that referenced this pull request Jan 16, 2026
clickhouse-gh Bot added a commit that referenced this pull request Jan 16, 2026
Backport #93658 to 25.12: Resubmit 'Skip back up of refreshable materialized view targets' #93076
robot-clickhouse added a commit that referenced this pull request Jan 17, 2026
jkartseva added a commit that referenced this pull request Jan 18, 2026
Backport #93658 to 25.11: Resubmit 'Skip back up of refreshable materialized view targets' #93076
robot-clickhouse added a commit that referenced this pull request Jan 19, 2026
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jan 19, 2026
clickhouse-gh Bot added a commit that referenced this pull request Jan 19, 2026
Backport #93658 to 25.10: Resubmit 'Skip back up of refreshable materialized view targets' #93076
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-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v25.12-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants