Repository navigation
Conversation
test_shutdown_cancels_backup checks that the backup is in flight and then calls restart_clickhouse(), which reaches SIGTERM only through docker exec calls (`ps -C clickhouse`, then `pkill -15`). In three CI failures that `ps` exec took 12.9-14.4 s (median 35 ms), stalled behind another pytest worker's container operation on the shared docker daemon. The sleep-dominated backup of the 10-part table lasts ~14 s, so it finished before SIGTERM arrived and was reported BACKUP_CREATED instead of BACKUP_CANCELLED. Build the table with 100 parts and sync the replicas before the backup, so each replica backs up about half of them: the backup now lasts ~105 s on both hosts and is still cancelled within a second of SIGTERM. The in-flight check also counted the initiator's own ON CLUSTER query. When the initiator was the restarted node, SIGTERM could arrive before its host-level part had started: its DDL entry was refused during shutdown, replayed after the restart, and the replay briefly re-created the backup's ZooKeeper node, which NoTrashChecker could see. Wait for the host-level part (is_initial_query = 0) instead, as test_cancel_backup does. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118630&sha=5ebb994042de3872804b53a14cc44d972f3e3286&name_0=PR&name_1=Integration%20tests%20%28amd_tsan%2C%20targeted%29 https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=gh-readonly-queue/master/pr-116528-e63bd29d291e9bd8413d5f1c07ac7f2cc663d7e4&sha=8d47e250cfd30e1fc1c4a6cf2a3e8bcace0dec59&name_0=MergeQueueCI&name_1=Integration%20tests%20%28amd_binary%2C%20targeted%29 https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117814&sha=d9b5c6c2b740e7c6bef2c9b6fc53e41f7cbed2d4&name_0=PR&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%20targeted%29 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 2 findings), plus my own cold review (0 findings).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261206-123600 |
Collaborator
Author
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261206-121100 |
Contributor
|
Workflow [PR], commit [ef22b92] Summary: ✅ AI ReviewSummaryThe PR stabilizes Missing context / blind spots
Final VerdictStatus: ✅ Approve |
This branch has not been deployed
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.
Related: #118630
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
test_backup_restore_on_cluster/test_cancel_backup.py::test_shutdown_cancels_backupfailed 3 times in 90 days withBACKUP_CREATEDinstead ofBACKUP_CANCELLED, always intargetedjobs on unrelated PRs (amd_tsan, amd_binary, arm_binary).The test checks that the backup is running, then calls
restart_clickhouse, which reaches SIGTERM only throughdocker execcalls. In all three failures the first one (ps -C clickhouse) took 12.9-14.4 s (median 35 ms in the same jobs), queued behind another pytest worker's container operation on the shared docker daemon. The backup of the 10-part table lasts ~14 s, so it had finished when SIGTERM arrived.Changes (test only):
test_long_disconnection_stops_backupdoes. The backup now lasts ~105 s on both hosts and is still cancelled within a second of SIGTERM.is_initial_query = 0, astest_cancel_backupdoes). When the restarted node was the initiator, itsON CLUSTERquery satisfied the old check before its part had started. Its DDL entry was then refused during shutdown and replayed after the restart, and the replay briefly re-created the backup's ZooKeeper node, whichNoTrashCheckersaw in 1 of 10 local runs.Validation (local, debug build): with a 20 s sleep before the restart standing in for the stall, master fails 3/3 with both CI signatures and this PR passes 3/3. With the initiator forced to be the restarted node: 0 refused or replayed DDL entries in 5 runs (24 refusals without the filter). The module passes, and the test passes 10/10.
The single-node
test_backup_restore_newsiblingtest_shutdown_cancel_backupis unchanged: its backup lasts ~32 s, more than twice the longest stall seen, and it has no such failures.Workflow [PR]
Sync PR [sync-upstream/pr/138099]