Backport of 'Make ci_finished_builds engine swap work on ClickHouse 23.x' into 19.1
What does this MR do and why?
Backports !240798 (merged) (merged commit b4f205d5) to 19-1-stable-ee.
The master MR !240798 (merged) missed the 19.1 release cutoff and was slipped to 19.2. This backport lands the same fix into the 19.1 stable branch so it ships in the next 19.1 patch release alongside the previously opened 19.0 / 18.11 / 18.10 backports.
What the fix does
ClickHouse post-deployment migration 20260108073937_alter_ci_finished_builds_engine_with_version was failing in three ways on stable branches that run ClickHouse 23.x/24.x. The master fix:
drop_tmp_tableUNKNOWN_SETTING on CH 23.x —SETTINGS max_table_size_to_drop = 0is only valid as a query-level setting on CH 24.0+; on CH 23.x it raisesCode: 115 UNKNOWN_SETTING. Worse, simply omitting it would fail DROP for any customer with >50 GB in tmp. Fixed by DETACHing every partition first (size check does not apply), then DROPping the empty table.- Version-agnostic spec — replaces a hardcoded SETTINGS string comparison with
not_to change { current_settings_clause }that works across all CH versions. supports_deduplicate_merge_projection_mode?gate threshold — corrected fromminor >= 1tominor >= 8to match when the setting was actually introduced in CH 24.x.- Self-healing
create_tmp_table— callsdrop_tmp_tablefirst and removesIF NOT EXISTSso a stale tmp table from an interrupted prior run is cleaned up rather than silently corrupting state.
Single cherry-pick of b4f205d5. No conflicts.
References
- Issue: #593129 (closed) (
severity::2,priority::2,Customer Interest,GitLab Dedicated) - Master MR: !240798 (merged)
- Sibling backports: !240591 (merged) (19.0), !240592 (merged) (18.11), !240593 (closed) (18.10)
- Customer ticket: ZD#700951
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
- The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
- The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
- Required labels have been applied to this merge request
- severity label and bug subtype labels (if applicable)
- If this MR fixes a bug that affects customers, the customer label has been applied.
- This MR has been approved by a maintainer (only one approval is required).
- Ensure the
e2e:test-on-omnibus-eejob has succeeded, or if it has failed, investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, request help in the #s_developer_experience Slack channel to confirm the failures are unrelated to the merge request.
Note to the merge request author and maintainer
If you have questions about the patch release process, please:
- Refer to the patch release runbook for engineers and maintainers for guidance.
- Ask questions on the
#releasesSlack channel (internal only). - Once the backport has been merged, the commit changes will be automatically deployed to a release environment that can be used for manual validation. See after merging runbook for details.