Skip to content

Stop and start merges, moves, TTLs and views in stress tests (merging when the CI gets green) - #114502

Merged
fm4v merged 5 commits into
masterfrom
more-stress
Aug 24, 2026
Merged

fm4v merged 5 commits into
masterfrom
more-stress

Conversation

@PedroTadim

@PedroTadim PedroTadim commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

Testing if this is going to uncover new issues. Renamed RandomKillerThread to RandomDisruptor


Workflow [PR]
Sync PR [sync-upstream/pr/114502]

Version info

  • Merged into: 26.9.1.7 (included in 26.9 and later)

@clickhouse-gh

clickhouse-gh Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e01892c]

Summary: ✅


AI Review

Summary

This PR turns the old random query killer into a broader RandomDisruptor that also injects server-wide SYSTEM STOP/START ... and SYSTEM PAUSE/START VIEWS during stress runs, and it teaches prepare_for_hung_check to SYSTEM START VIEWS. High-level verdict: the new global background-action toggles still break existing stress-test preconditions and can leave the run in an unverified global state after failed restarts, so I do not think the ordinary stress job is safe to merge like this.

Missing context / blind spots
  • ⚠️ The only CI artifact currently visible on the PR is Build profile diff; there is no stress-job report yet, so I could not corroborate these harness concerns against an actual stress run.
Findings

⚠️ Majors

  • [ci/jobs/scripts/stress/stress.py:75] [dismissed by author -- https://github.com/Stop and start merges, moves, TTLs and views in stress tests (merging when the CI gets green) #114502#discussion_r3767708348] Server-wide SYSTEM START/STOP MERGES still goes through InterpreterSystemQuery::startStopActionInDatabase, and ActionLocksManager still keeps a single lock per (table, action_type). A random global start therefore erases a test's own SYSTEM STOP MERGES <table> lock; the same generic path also applies to the new TTL MERGES and MOVES pairs. I still consider it real because tests such as tests/queries/0_stateless/03644_cancel_huge_mutation_subquery.sh use SYSTEM STOP MERGES to force the cancellation/hang-sensitive path, so this can mask the very failures the stress job is supposed to surface.
  • [ci/jobs/scripts/stress/stress.py:275] [dismissed by author -- https://github.com/Stop and start merges, moves, TTLs and views in stress tests (merging when the CI gets green) #114502#discussion_r3767708353] The retry loop reduces the window, but after the last failed SYSTEM START ... attempt the code still logs and continues. I still consider it real because _SYSTEM_STATEMENT_TIMEOUT is intentionally short, and a timed-out restart leaves merges / moves / views potentially stopped until some later lucky iteration or prepare_for_hung_check, so later failures no longer run under the intended workload.
  • [ci/jobs/scripts/stress/stress.py:78] SYSTEM START VIEWS removes both ViewRefresh and ViewRefreshPause locks for every refreshable view on the server (src/Interpreters/InterpreterSystemQuery.cpp:959-965), so the disruptor can re-enable views that a test intentionally stopped or paused with SYSTEM STOP VIEW / SYSTEM PAUSE VIEW. That breaks existing stateless RMV tests: tests/queries/0_stateless/02932_refreshable_materialized_views_2.sh uses SYSTEM STOP VIEW to hold rmv_e / rmv_h disabled across renames and final reads, and tests/queries/0_stateless/04105_system_pause_view.sh is tagged no-parallel precisely because SYSTEM PAUSE/START VIEWS are server-global. The disruptor runs inside those tests, so it can create flakes and false greens.
Final Verdict

Changes requested. The new server-wide background-action disruptions still clobber test-owned locks, and the restart path still allows the stress run to continue after it loses track of the server's global state.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 12, 2026
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
@PedroTadim PedroTadim changed the title Stop and start merge, moves, ttls and views in stress tests (merging when the CI gets green) Stop and start merges, moves, ttls and views in stress tests (merging when the CI gets green) Aug 12, 2026
@PedroTadim PedroTadim changed the title Stop and start merges, moves, ttls and views in stress tests (merging when the CI gets green) Stop and start merges, moves, TTLs and views in stress tests (merging when the CI gets green) Aug 12, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing e01892cac with master dabcc4cde (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 704.37 MiB 701.33 MiB -3.04 MiB (-0.43%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

8 translation units recompiled, 13 s compile time in total, 8 of them have a recent master baseline.

Job report

@rahulmalik87 rahulmalik87 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thank you @pedro, very good changes to catch for hang or crashes. one concern if there a test and that does stop merge on a table and does something but now start merge can land in between and change the result. but IIUC we are only checking of crashes and hang. incase if we see any issue it could be worth to pick a random table from system.tables

@PedroTadim

Copy link
Copy Markdown
Member Author

thank you @pedro, very good changes to catch for hang or crashes. one concern if there a test and that does stop merge on a table and does something but now start merge can land in between and change the result. but IIUC we are only checking of crashes and hang. incase if we see any issue it could be worth to pick a random table from system.tables

Exactly as you said, stress tests don't check for correctness.

Comment thread ci/jobs/scripts/stress/stress.py Resolved
@fm4v
fm4v added this pull request to the merge queue Aug 24, 2026
Merged via the queue into master with commit 0df2479 Aug 24, 2026
177 checks passed
@fm4v
fm4v deleted the more-stress branch August 24, 2026 10:35
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci 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.

4 participants