{{ message }}
Do not ignore DROP for refreshable materialized views in stress tests#102008
Merged
Conversation
The `ignore_drop_queries_probability` setting converts DROP TABLE to TRUNCATE TABLE, but TRUNCATE does not stop the periodic refresh task of a refreshable materialized view. This causes the orphaned view to keep refreshing indefinitely, consuming background pool threads and progressively overwhelming the server (especially under TSan). Root cause of the "Hung check failed, possible deadlock found" flake in Stress test (arm_tsan). Test `03221_refreshable_matview_progress.sql` creates an MV with `REFRESH AFTER 10 SECOND`. When the stress test converts its final `DROP TABLE` to `TRUNCATE`, the view survives and keeps refreshing for the rest of the stress test (48 refreshes observed), with each refresh getting slower under TSan (from sub-second to 59 minutes), until the server becomes completely unresponsive. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=99997&sha=355f90c5ba8982dc501d353f211c43350cfbc20e&name_0=PR&name_1=Stress%20test%20%28arm_tsan%29 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Contributor
LLVM Coverage ReportChanged lines: 100.00% (9/9) | lost baseline coverage: 1 line(s) · Uncovered code |
This was referenced Apr 10, 2026
Merged
This was referenced Apr 10, 2026
Merged
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 16, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 16, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 16, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 16, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 16, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 16, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 16, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 16, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 16, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 16, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 17, 2026
…lickHouse#101994, ClickHouse#102158, ClickHouse#101952, ClickHouse#102148, ClickHouse#102008, ClickHouse#102010) # Conflicts: # src/Common/AsynchronousMetrics.cpp
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 17, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 17, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 17, 2026
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 18, 2026
…lickHouse#101994, ClickHouse#102158, ClickHouse#101952, ClickHouse#102148, ClickHouse#102008, ClickHouse#102010) # Conflicts: # src/Formats/FormatSettings.h
Onyx2406
added a commit
to Onyx2406/ClickHouse
that referenced
this pull request
Apr 18, 2026
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.

The
ignore_drop_queries_probabilitysetting (used in stress tests) convertsDROP TABLEtoTRUNCATE TABLE, butTRUNCATEdoes not stop the periodic refresh task of a refreshable materialized view. This causes the orphaned view to keep refreshing indefinitely, consuming background pool threads and progressively overwhelming the server — especially under TSan where each operation is 5–15x slower.Root cause analysis of the "Hung check failed, possible deadlock found" flake in
Stress test (arm_tsan):03221_refreshable_matview_progress.sqlcreates an MV withREFRESH AFTER 10 SECONDignore_drop_queries_probability=0.2converts the finalDROP TABLEtoTRUNCATE TABLEFix: skip the DROP-to-TRUNCATE conversion for refreshable materialized views, since
TRUNCATEdoesn't stop their periodic refresh task.CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=99997&sha=355f90c5ba8982dc501d353f211c43350cfbc20e&name_0=PR&name_1=Stress%20test%20%28arm_tsan%29
#99997
Relates to #101383
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Version info
26.4.1.676