Repository navigation
Keep BACKUP/RESTORE ON CLUSTER timeouts and Keeper retries when compatibility is 24.10 or older - #123752
Conversation
…compatibility The four settings added by the 24.10 BACKUP ON CLUSTER coordination rewrite (backup_restore_failure_after_host_disconnected_for_seconds, backup_restore_keeper_max_retries_while_initializing, backup_restore_keeper_max_retries_while_handling_error, backup_restore_finish_timeout_after_error_sec) carry "New setting" history records with a previous value of 0, so compatibility <= 24.10 sets them to 0. In the current code 0 means no Keeper retries while initializing or handling an error, no lost-host detection and an untimed wait after an error. A host that fails its first Keeper step and then fails to write its error never reports anything, so the initiator's waitOtherHostsFinish(throw_if_error = false) in BackupStarter::onException waits forever: KILL QUERY does not stop it and shutdown_wait_backups_and_restores blocks server shutdown. No release behaved like this: 24.9 retried those steps with backup_restore_keeper_max_retries (20) and did not wait for other hosts after an error. Stress tests hit it through compatibility randomization plus backup Keeper fault injection (ClickHouse#116783). Add a 26.10 CompatibilitySetting::Ignore record (ClickHouse#114190) to each of the four settings, so any compatibility value keeps their defaults. The 24.10/24.11 records are unchanged, backup_restore_keeper_max_retries still rolls back to 24.9's 20, and an explicit SET still wins. 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; 0 findings) plus my own cold review (1 finding).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261003-202000 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261003-174503 |
|
Workflow [PR], commit [b4c9b1c] Summary: ✅
AI ReviewSummaryThis PR fixes a real Final Verdict
LLVM Coverage ReportMeasured on commit b4c9b1c.
Changed lines: Changed C/C++ lines covered: 19/19 (100.00%) · Uncovered code |
Build profile diff (arm_release)Commit See the job log for details. |
CI finish ledger - c5a8f25Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Neither touches the Session id: cron:our-pr-ci-monitor:20261004-013156 |
…-on-cluster-bounds
|
Fixing PR for 04401_http_query_parameters_not_leaked_to_logs (timeout in the arm_binary ParallelReplicas lane) created: #123814 |
CI finish ledger - b4c9b1cEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
All 146 check runs completed, Session id: cron:our-pr-ci-monitor:20261004-070344 |
|
Version 24.10 is no longer supported. @groeneai can you instead create a PR that sets the minimum compatibility version in tests to 26.3? |
|
Acknowledged. I am preparing a new PR that raises the minimum randomized |
|
The new PR is #124027: it raises the minimum randomized |
|
Sorry, this is needed |
|
Understood, #124027 stays closed and I am dropping the upper-bound change asked there. This PR is unchanged and ready for review. |
04401_http_query_parameters_not_leaked_to_logs bounded its six system.text_log reads only by `event_time >= now() - INTERVAL 600 SECOND`, so every read scanned the last ten minutes of the whole server's log. On the parallel `Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel)` server that is ~4.7M rows / ~120 MB of `message` per scan, and with `remote_filesystem_read_method = 'read'`, `enable_filesystem_cache = 0` and 1 MiB remote read tasks the five `message LIKE` scans took 97-222 s each, so the test hit the 600 s timeout (ClickHouse#123752, ClickHouse#122362). Take `toUnixTimestamp(now())` before the first request and bound all six reads with `event_time >= toDateTime(test_start)`, as ClickHouse#123652 did for 05061. Every asserted line is logged after that point, so the reference is unchanged; text_log is ordered by (event_date, event_time), so the bound prunes the read to the test's own granules. Locally, with 681K rows in the ten-minute window, a scan reads 381 rows instead of 681,982. Co-Authored-By: Claude Opus 5.5 <[email protected]>
39aee24
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed
BACKUP/RESTORE ... ON CLUSTERhanging forever, unaffected byKILL QUERYand blocking server shutdown, whencompatibilityis set to24.10or older and a host fails on a Keeper error before it starts. Such acompatibilityvalue no longer setsbackup_restore_finish_timeout_after_error_sec,backup_restore_failure_after_host_disconnected_for_seconds,backup_restore_keeper_max_retries_while_initializingandbackup_restore_keeper_max_retries_while_handling_errorto0, a combination no release ever used.Description
On 26.8 (and every release since 24.11), with
compatibilityset to24.10or older, aBACKUP ... ON CLUSTERwhose host fails on a Keeper error before it starts never finishes:KILL QUERYdoes not stop it and the server cannot shut down while it runs.These four settings came with the 24.11 coordination rewrite, and their
New settinghistory records roll them back to0. In the current code0means no Keeper retries while initializing or handling an error, and no bound on the initiator's wait after an error (BackupCoordinationStageSync::waitOtherHostsFinish). A host that fails its first Keeper step and then fails to write its error never reports anything, so the initiator waits for it forever. Releases before 24.11 had neither behaviour: they retried those steps (20 times) and did not wait for other hosts after an error.The stress tests randomize
compatibilityand, since #116783, inject Keeper faults into backups, so the hung check now hits this: 4 times in 10 days, e.g. on master: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=ddae0611a3ab661ca71bd60ed21d202c4a544542&name_0=MasterCI&name_1=Stress%20test%20%28arm_debug%29The fix adds a
CompatibilitySetting::Ignorerecord (#114190) to each of the four settings, so they keep their defaults under anycompatibility.backup_restore_keeper_max_retriesstill rolls back to 20 (the 24.9 value), and an explicitSETstill wins.Validation: the new test fails on master (four rows
0). On a local server withcompatibility = '22.10'and the stress fault probability (0.05), 400BACKUP ... ON CLUSTEReach: master left 11 stuck (up to 73 min,KILL QUERY ... SYNCtimed out, no exit 90 s after SIGTERM), this branch 0 (exit in 4 s).test_backup_restore_on_cluster/test_different_versions(profilecompatibility24.9) passes.Workflow [PR]
Sync PR [sync-upstream/pr/123752]
Version info
26.10.1.2069-master(included in26.10and later)