Skip to content

Remove failpoint tests of table_readonly toggle windows and cancellation/timeout windows - #125008

Merged
alexey-milovidov merged 3 commits into
masterfrom
remove-readonly-cancel-failpoint-tests
Oct 10, 2026
Merged

alexey-milovidov merged 3 commits into
masterfrom
remove-readonly-cancel-failpoint-tests

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

The job Stateless tests (arm_asan_ubsan, azure, sequential) hits its 9000 s timeout: its median runtime on master grew from about 7900 s on 2026-10-01 to about 8700 s on 2026-10-09, and 7 of 22 master runs timed out on 2026-10-09.

This removes 31 tests that reproduce narrow windows of the table_readonly ALTER (rollback before the metadata commit, the post-commit tail, outdated parts loading while toggling) or of query cancellation/timeouts (url table function, KILL QUERY, remote/parallel replicas cancellation, TRUNCATE DATABASE, outdated parts loading on DETACH), all by pausing or throwing at server-global failpoints. Together their median runtime in this job since 2026-10-01 is about 448 s.

The tests which check the basic user-visible behavior of table_readonly without failpoints are kept (03924, 04062, 04063, 04321, 04357, 04490, 04491, 05183, 05184, 05185, 05186, 05191, 05192, 05219, 05223), as are the url cancellation/timeout tests that use only a local mock HTTP server and no failpoints. 05212_readonly_storage_policy_toggle_rollback is also kept, as the only regression test for the failed pre-commit path of a combined MODIFY SETTING table_readonly = 0, storage_policy = .... The failpoint-free part of the removed 05235 (a read-only table as the source of ATTACH PARTITION ... FROM) is folded into a new test 05353_table_readonly_attach_partition_source.

Removed tests (median seconds):

  • 05024_url_function_schema_inference_soft_timeout (40.3)
  • 04763_kill_query_merge_table_plan (37)
  • 05317_kill_query_totals_having (35.2)
  • 04741_cancel_skip_index_marks_remote_read (34.9)
  • 04839_parallel_replicas_cancel_before_announcement (27.5)
  • 05238_readonly_toggle_disables_workers_before_commit (24.1)
  • 05218_readonly_toggle_window_keeps_outdated_parts_unloaded (16.2)
  • 05221_readonly_rolled_back_toggle_tears_down_started_workers (15.5)
  • 05235_readonly_toggle_window_source_of_attach_partition (15.1)
  • 05217_readonly_toggle_window_keeps_workers_inert (12.4)
  • 05224_readonly_live_toggle_stops_queued_outdated_parts_loading (12)
  • 05220_readonly_live_toggle_suspends_outdated_parts_loading (11.9)
  • 04871_url_function_hard_cancel_upgrade_after_interrupted_read (11.8)
  • 05225_readonly_rolled_back_toggle_wakes_pending_workers (11.5)
  • 05228_load_outdated_parts_cancel_on_detach (11.1)
  • 05233_readonly_toggle_window_rejects_writes (10.4)
  • 03984_truncate_database_sync_cancellation (10.4)
  • 04516_mutation_kill_transaction_race (9.7)
  • 04765_kill_create_as_select_cleanup_drop (9.3)
  • 05222_readonly_rolled_back_toggle_after_assignee_task_created (9.3)
  • 05234_readonly_post_commit_window_rejects_partition_moves (9)
  • 05076_url_function_hard_timeout_after_pull (9)
  • 05211_readonly_start_workers_rollback (8.9)
  • 05054_url_function_hard_timeout_while_option_error_unwinds (8.9)
  • 05076_remote_query_executor_cancel_during_drain (8.2)
  • 04906_url_function_no_next_read_after_cancel (7.3)
  • 05048_url_function_killed_query_while_option_error_unwinds (6.5)
  • 04869_url_function_stale_metadata_error_after_soft_cancel (6.2)
  • 04846_url_function_no_second_metadata_probe_after_cancel (6.2)
  • 04891_url_function_no_initial_get_after_cancel (6.1)
  • 04904_url_function_no_chunk_after_cancel (6)

The change is test-only. These failpoints are no longer used by any test: http_read_buffer_pause_before_metadata_fallback, merge_tree_load_outdated_parts_pause, mt_alter_readonly_pause_after_metadata_commit, mt_alter_readonly_throw_in_start_background_workers, mt_alter_settings_pause_before_metadata_commit, mt_background_jobs_assignee_throw_after_task_created, mt_pause_before_loading_outdated_part, mt_pause_before_loading_queued_outdated_part, mt_pause_before_register_mutation, parallel_replicas_delay_announcement, remote_fs_gather_pause_in_read, remote_query_executor_cancel_in_finish_drain, storage_url_pause_after_pull, storage_url_pause_before_empty_file_probe, storage_url_pause_before_handling_interrupted_read_error, storage_url_pause_before_handling_option_error, storage_url_pause_before_read_buffer_creation, storage_url_pause_before_request_attempt, storage_url_pause_before_retry_attempt, storage_url_pause_between_metadata_probes, totals_having_transform_drop_cancelled_chunk, totals_having_transform_pause, truncate_database_tables_pause.

Related: #125003
Related: #125005

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

🤖 Generated with Claude Code


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

Version info

  • Merged into: 26.10.1.2012-master (included in 26.10 and later)

…ellation/timeout windows

The job `Stateless tests (arm_asan_ubsan, azure, sequential)` hits its 9000 s timeout.
Remove 32 tests that reproduce narrow windows of the `table_readonly` `ALTER` or of
query cancellation/timeouts with server-global failpoints (median runtime about 457 s in total
in this job). Fold the failpoint-free user-visible checks of
`05212_readonly_storage_policy_toggle_rollback` and
`05235_readonly_toggle_window_source_of_attach_partition` into a new test
`05353_table_readonly_partition_source_and_combined_alter`.

Related: #125003
Related: #125005

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [dfd259e]

Summary: ✅


AI Review

Summary

This PR removes 31 failpoint-backed stateless tests to pull the sequential ASan job back under its 9000 s timeout, keeps 05212_readonly_storage_policy_toggle_rollback, and folds the steady-state ATTACH PARTITION ... FROM case into 05353_table_readonly_attach_partition_source. I still see two new coverage regressions around the live table_readonly 1 -> 0 transition, plus one previously discussed gap that remains real after the author's trade-off decision: the remaining suite no longer exercises the pre-commit write-rejection window or the post-commit worker-restart window that StorageMergeTree::alter still treats as correctness-critical.

Findings

⚠️ Majors

  • [tests/queries/0_stateless/05233_readonly_toggle_window_rejects_writes.sh:20] Dropping this test removes the only coverage that readonly_commit_in_flight keeps foreground writes rejected during the pre-commit table_readonly 1 -> 0 window. 03924_table_readonly_setting, 04490_table_readonly_partition_commands, 05210_readonly_settings_rollback, and 05212_readonly_storage_policy_toggle_rollback only check stable states or after-the-fact rollback; none pauses at mt_alter_settings_pause_before_metadata_commit and probes INSERT / MOVE PARTITION TO TABLE while changeSettings has already published table_readonly = 0 in memory. A regression here can durably write into a table whose failed commit restores table_readonly = 1.
  • Suggested fix: keep one failpoint-backed pre-commit window test, even if it only covers one of the two write entrypoints.
  • [tests/queries/0_stateless/05234_readonly_post_commit_window_rejects_partition_moves.sh:24] Removing this test leaves no coverage for the post-commit gap after a successful table_readonly 1 -> 0 toggle, where the table is durably writable but its workers and outdated-part loaders are still disabled. 05353_table_readonly_attach_partition_source only checks a stably read-only source of ATTACH PARTITION ... FROM; it never exercises mt_alter_readonly_pause_after_metadata_commit, so a regression where MOVE PARTITION TO TABLE runs before deferred outdated parts load would now be untested.
  • Suggested fix: keep one failpoint-backed post-commit window case on the destination table.
  • [tests/queries/0_stateless/05353_table_readonly_attach_partition_source.sql:25] [dismissed by author -- https://github.com/Remove failpoint tests of table_readonly toggle windows and cancellation/timeout windows #125008#discussion_r4235289308] 05353 preserves only the steady-state ATTACH PARTITION ... FROM case. After deleting 05235_readonly_toggle_window_source_of_attach_partition, there is still no coverage for running ATTACH PARTITION ... FROM while the source table is inside either live-toggle window, even though StorageMergeTree::alter keeps both windows explicit and the deleted test showed that the command intentionally bypasses alter_lock. I still think one window case should stay because otherwise a reintroduced wait/hang on the source toggle has no regression test.
  • Suggested fix: keep at least one trimmed window case, for example one failpoint and one destination table.
Final Verdict

⚠️ Changes requested. This PR still drops the only tests for two correctness-critical table_readonly transition windows, and the steady-state replacement does not cover them.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Oct 9, 2026
SELECT 'source parts while read-only', countIf(active), countIf(NOT active)
FROM system.parts WHERE database = currentDatabase() AND table = 'readonly_src';

ALTER TABLE readonly_dst ATTACH PARTITION ID 'all' FROM readonly_src;

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.

This new check only exercises ATTACH PARTITION ... FROM while the source is stably read-only. The deleted 05235_readonly_toggle_window_source_of_attach_partition was the only coverage for the two live-toggle windows (mt_alter_settings_pause_before_metadata_commit and mt_alter_readonly_pause_after_metadata_commit), where the source's locking and outdated-part loading behavior is different. If ATTACH PARTITION starts waiting for the source toggle to finish again, or if it begins loading the deferred outdated parts in those windows, this PR leaves us with no regression test for that hang/state-divergence.

Can we keep at least one failpoint-backed window case in a slower suite instead of dropping both?

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.

🕵 Not restoring 05235: removing failpoint tests that pause inside the live toggle windows (mt_alter_settings_pause_before_metadata_commit, mt_alter_readonly_pause_after_metadata_commit) is the purpose of this PR, because the sequential ASan job keeps hitting its timeout. There is no slower suite for stateless tests besides that job. The user-visible behavior — a stably read-only source of ATTACH PARTITION ... FROM and deferred outdated-parts loading after the toggle — is still covered by 05353. If the window cases are judged essential, that is a trade-off for a human reviewer.

@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 9, 2026
@alexey-milovidov alexey-milovidov added the blocker This issue / pr blocks a new release label Oct 9, 2026
alexey-milovidov and others added 2 commits October 10, 2026 06:38
…ack`

It is the only regression test for the failed pre-commit path of a combined
`MODIFY SETTING table_readonly = 0, storage_policy = ...`, where the
`storage_policy` change can wake the move assignee before the metadata rollback.
`05210_readonly_settings_rollback` already uses the same failpoint and runs in
the sequential job, so keeping it costs about 9.5 s.

The success path of the combined `ALTER` in `05353` duplicated the retry part of
`05212`, so it is removed, and the test is renamed to
`05353_table_readonly_attach_partition_source` to match what is left in it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rtition_source`

It duplicates the retry part of the restored `05212_readonly_storage_policy_toggle_rollback`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# metadata commit. The table is durably read-only until the commit succeeds, and the `ALTER` only
# holds `alter_lock`, which does not serialize with the `lockForShare` that the write paths take. A
# foreground query that passed `assertNotReadonly` in that window would modify a table whose failed
# commit restores `table_readonly = 1`, leaving new data on a durably read-only table.

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.

This drops the only regression test for the pre-commit table_readonly 1 -> 0 window. StorageMergeTree::alter still relies on readonly_commit_in_flight to keep foreground writes rejected until the metadata commit actually succeeds or rolls back, because changeSettings has already published table_readonly = 0 in memory before then. After this deletion there is no test left for an INSERT or MOVE PARTITION TO TABLE slipping through that window and leaving new data on a table whose failed commit restores table_readonly = 1.

Please keep one failpoint-backed pre-commit write-rejection case here, even if it is reduced to a single entrypoint.

}
trap cleanup EXIT

# A successful `table_readonly` 1 -> 0 toggle commits the setting before it restores the background

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.

This removes the only regression test for the post-commit gap after table_readonly 1 -> 0, where the setting is already durable but the background workers and outdated-part loaders are not back yet. StorageMergeTree::alter explicitly keeps readonly_commit_in_flight set across mt_alter_readonly_pause_after_metadata_commit for exactly this reason. 05353 does not replace it because it only checks a stably read-only source table, not a destination command running in that post-commit gap.

Please keep one failpoint-backed MOVE PARTITION TO TABLE case for this window.

@clickhouse-gh

clickhouse-gh Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing dfd259ec4 with master d741c9860 (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

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

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

Job report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocker This issue / pr blocks a new release comp-testing Test content only (no production code). pr-not-for-changelog This PR should not be mentioned in the changelog 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.

2 participants