Repository navigation
fix: propagate incremental download failures to waiting workers - #1704
Open
compiler-segfault wants to merge 1 commit into
Open
compiler-segfault wants to merge 1 commit into
compiler-segfault wants to merge 1 commit into
Conversation
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.
An exhausted download of a required incremental-backup archive can leave
restore_remotein progress indefinitely.downloadDiffRemoteFilereturns on the error without unlocking its per-file mutex; a subsequent caller waits on that mutex while holding the cache mutex. Thanks to @vgproskurin for the report and the independent Docker reproducer.Replace the cached mutex with a completion channel and the download result. The owner publishes its error on every return path, including resume-state write failures. Cached callers wait outside the map lock and can return when their own context is cancelled. Successful cached calls still return zero downloaded bytes. Merely deferring the old unlock would allow these callers to return success after a failed download.
Fixes #1681.
Validation on Linux/amd64, Go 1.27.0, against baseline
abc187421f56c3c67bb8a64e2ae37892a2a1f037:go test ./pkg/backup -run TestDownloadDiffRemoteFile -count=10 -timeout=120sgo test -race ./pkg/backup -run TestDownloadDiffRemoteFile -count=10 -timeout=180sgo vet ./...,go test ./... -count=1 -timeout=300s, andgofmtchecks.664a269d663f45b4bf53b12e14ac697c1c5f98f9reproduces the hang with both the published 2.8.3 image and a binary built from the pinned baseline: two completed truncated responses, no active faulty responses, and two blocked mutex waiters. Substituting the patched binary into the same 2.8.3 container returns an action error containing the originalunexpected EOF, with zero blocked waiters. A separate no-fault control restores all 12,544 rows with the original data fingerprint.The Docker check uses ClickHouse 26.8.36.3, SeaweedFS 4.00 and the reporter's synthetic fixture. It does not establish results for other ClickHouse versions or cloud services; the repository's separately tagged integration matrix was not run locally.
Follow-up on the ClickHouse 26.3 CI failure: I replayed the first local create/drop/restore sequence from
TestInnerTablesMaterializedViewagainst the pinned baseline and this PR on ClickHouse 26.3.75.5 with the sameON CLUSTERschema-restore setting. Both returned code 60 for the missingtest_mv.src_table. With the source table included in the backup, both restored 100 rows in each view. This was an isolated replay of the failing local sequence, without the S3 portion of the CI test.AI disclosure: This patch, regression tests and PR text were prepared autonomously by OpenAI Codex under the account owner's authorization. Codex ran the checks described above; no human code review is claimed. The report and public reproducer are the reporter's work.