Repository navigation
Upgrade check: cancel the stress phase's leftover queries before restarting replicas - #123841
Conversation
…arting replicas A stress query can outlive the stress phase and keep a shared lock on a replicated table. In the failing job a `merge()` SELECT of 01169_old_alter_partition_isolation_stress kept retrying the S3 listing of a table left on an unreachable endpoint by 04627. The drain's `SYSTEM RESTART REPLICA` shut the replica down, timed out after lock_acquire_timeout waiting for the exclusive lock (DEADLOCK_AVOIDED, owner = that query), and left the replica read-only, so `SYSTEM SYNC REPLICA ... PULL` failed with TABLE_IS_READ_ONLY and the step reported a failure with nothing left to drain. Cancel every running query once, before the mutation section. Nothing uses their results: their clients are gone, and the stop of the old server does not cancel them either (the test config sets shutdown_wait_unfinished_queries, so the stop waits shutdown_wait_unfinished and exits with them still running). The drain itself is unchanged and still fails closed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex, 2 runs; 1 finding) plus my own cold review (1 finding, 1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261004-082300 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261004-081900 |
|
Workflow [PR], commit [d41d151] Summary: ✅ AI ReviewSummaryThis PR updates Final Verdict
|
alexey-milovidov
left a comment
There was a problem hiding this comment.
At least it does not harm.
Related: #123376
Related: #123069
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Upgrade check: cancel the queries left over from the stress phase before replicas are restarted, so a leftover query holding a table lock cannot make the restart time out and fail the job.
Description
Upgrade check (amd_release)failed on #123069, which only changes proxy code, withCannot run the mutation entries left behind by the killed mutations, a row added by #123376: report. Requested by @ alexey-milovidov in #123069 (comment).Root cause. A stress query (
01169_old_alter_partition_isolation_stress.sh,SELECT ... FROM merge(currentDatabase(), '')) outlived the stress phase. Its database still had the S3 table that an interrupted04627_object_storage_lazy_hive_partitioningleft onhttp://localhost:1, so the query kept retrying the listing (attempt 189 of 501) while it held a shared lock on every table of the database. The drain'sSYSTEM RESTART REPLICAshuts the replica down and then waits for the exclusive lock. Afterlock_acquire_timeout(60 s in CI) it failed withDEADLOCK_AVOIDED, naming that query. The replica stayed read-only, soSYSTEM SYNC REPLICA ... PULLfailed withTABLE_IS_READ_ONLY. NoMUTATE_PARTwas queued.Change. Run
KILL QUERY WHERE 1 SYNConce, after theTables countprobe and before the mutation section. Nothing uses these queries: their clients are gone, and the old server's stop does not cancel them either (the test config setsshutdown_wait_unfinished_queries, so the stop waits 60 s and exits with them still running, as in this job). The drain and its fail-closed checks are unchanged.Validation. Local rig on 26.9.9.28 (the release CI used): a killed mutation on a replicated table, plus the same
merge()query over an unreachable S3 table, with its client gone. Without the change, 3 of 3 runs give the CI failure row (TABLE_IS_READ_ONLY,DEADLOCK_AVOIDEDon that query). With it, 5 of 5 runs cancel the query in under 1 s and pass, and the step takes 1.7 s instead of 120 s. With nothing to cancel, and on the #123376 fixtures, the rows are unchanged.Workflow [PR]
Sync PR [sync-upstream/pr/123841]
Version info
26.10.1.1966-master(included in26.10and later)