Repository navigation
Backport #108728 to 26.3: Fix CREATE OR REPLACE MATERIALIZED VIEW ... POPULATE losing the source subscription - #115449
Merged
Merged
Conversation
… POPULATE losing the source subscription
Contributor
|
Workflow [BackportPR], commit [9dd857d] Summary: ✅ |
`CREATE OR REPLACE MATERIALIZED VIEW` does not exist on 26.3: the parser guards the `MATERIALIZED` keyword with `!replace_view` and only master dropped that guard, in `ed062fd96e1` (first released in 26.5). Both backported tests therefore failed with `Syntax error ... at position 19 (MATERIALIZED)` rather than exercising anything. `04493` also collided with the existing `04493_async_insert_dedup_optimize_on_insert_replicated_merge_tree`. The backported fix is still wanted here, because the same stale storage-cache entry breaks `CREATE OR REPLACE TABLE ... AS SELECT`, which 26.3 does support: the internal drop of the replaced table resolves the temporary name to the new, live table and cancels its merges forever. So both tests are replaced by one that covers that path. Verified in both directions with release binaries: on 26.3.17.110, which lacks the fix, `OPTIMIZE` fails with `Code: 236 ... Cancelled merging parts (ABORTED)`; on 26.7.4.58, which has it, the test passes. Related: #115288 Related: #108728 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
bytehalo-infra
added a commit
to sentioxyz/ClickHouse
that referenced
this pull request
Sep 25, 2026
OTHER: CREATE OR REPLACE TABLE ... AS SELECT over an existing table -> the internal DROP of the replaced table resolves the temporary name through a stale storage-cache entry and shuts down the new, live table: its merges are cancelled for good (every OPTIMIZE fails with ABORTED, background merges never run again until a restart). Upstream reaches the same cache also through CREATE OR REPLACE MATERIALIZED VIEW ... POPULATE (the source subscription is lost). Effect in the production build a394e92: the backport's test 04492_create_or_replace_table_as_select_keeps_merges fails on it and passes on official 26.8.8.8, run on isolated servers (evidence/fix_ci_20260925/upstream_repro/corrected3/). The upstream tests 04492/04493 (MATERIALIZED VIEW ... POPULATE) are no evidence here: 26.3 has no CREATE OR REPLACE MATERIALIZED VIEW, so they fail on it with a syntax error. Upstream patch unchanged, with the backport's test: 04492_create_or_replace_table_as_select_keeps_merges. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original pull-request #108728
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job
Version info
26.3.20.9