Repository navigation
Retry asynchronous table loading after transient CAS mount failures - #2498
Open
pauloschade wants to merge 2 commits into
Open
pauloschade wants to merge 2 commits into
pauloschade wants to merge 2 commits into
Conversation
I, Paulo Chade <paulochade0505@gmail.com>, hereby add my Signed-off-by to this commit: bb31af1 Signed-off-by: Paulo Chade <paulochade0505@gmail.com>
Member
This one should be addressed in #2440 And most probably after that the problem will go away.
This one i'm looking on (making the leases more robust). Regarding the retries in async loader - it may make sense, but we're trying to limit the impact on the upstream code and avoid all kinds of |
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.
1 — Previous behavior
When a CAS mount lost its lease, table-loading tasks could fail while storage was unavailable. The mount could subsequently recover, but failed or canceled loading tasks retained their errors.
2 — Problem
Tables remained unavailable after the underlying storage recovered. Restoring access required restarting ClickHouse, even though the mount was already healthy.
3 — Fix
Retry table construction during asynchronous loading when it encounters the identified transient CAS mount failure. Keep permanent failures terminal and preserve the existing lease fencing. Allow shutdown to interrupt recovery without waiting indefinitely.
Production example
Our deployment uses one writer and two readers backed by shared S3 storage. During an incident, S3 returned
503 Slow Down, and the writer lost its CAS lease. The mount recovered automatically, but table-loading tasks remained failed or canceled until we restarted the affected server. After deploying the patch, another S3 throttling episode caused the writer to lose and recover its lease during startup. All 1,043 loading tasks subsequently completed without another restart, and our query and RLS checks passed.Changelog category
Changelog entry
Recover asynchronous table loading after transient CAS mount failures without requiring a server restart.
Documentation entry for user-facing changes
tests/integration/test_cas_load_recovery/README.md.Validation
The included Docker Compose reproduction is standalone and is not wired into the upstream pytest runner. On ARM64 Linux, the unmodified build reproduced persistent loading failures after remount; the patched build recovered writer and reader without a recovery restart, preserved rows and RLS, continued rejecting terminal mount states, and shut down during a fault in 3.87 seconds. The six changed C++ files match the deployed and tested patch; this submission excludes our image packaging and deployment scripts.
Published test evidence: https://github.com/use-kayro/ClickHouse/releases/tag/v26.6.4.20001-kayro-cas1-rc2
CI/CD Options
Regression jobs to run: