CASSANDRA-16047: Tolerate missing source components during incremental backup linking - #5149
Open
cheeeee wants to merge 1 commit into
Open
CASSANDRA-16047: Tolerate missing source components during incremental backup linking#5149cheeeee wants to merge 1 commit into
cheeeee wants to merge 1 commit into
Conversation
…(CASSANDRA-16047) When incremental backups are enabled (incremental_backups: true), every added or flushed SSTable triggers Tracker.maybeIncrementallyBackup(), which invokes SSTableReader.createLinks() to create hard links for each component file into the backups/ directory. Previously, if a component was deleted by concurrent compaction, cleanup, or drop in the TOCTOU window between existence checking and link creation, Files.createLink() threw NoSuchFileException, which FileUtils.createHardLink() unconditionally wrapped into FSWriteError. Under the default disk failure policy (die), this caused immediate JVM shutdown and production cluster node crashes. This patch: 1. FileUtils.createHardLink: distinguishes missing source files (throwing UncheckedIOException wrapping NoSuchFileException) from true disk write failures (FSWriteError). 2. SSTableReader.createLinks: catches NoSuchFileException when the source file was concurrently unlinked, logs a DEBUG message, and cleanly skips the obsolete component without aborting or triggering disk failure policies. 3. SSTableReaderTest: adds testCreateLinksToleratesMissingComponent verifying clean completion without FSWriteError. Fixes: CASSANDRA-16047
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.
Status: changes requested — not ready to merge
The published change does not establish snapshot completeness. The added test has reference-ownership and race-coverage defects; incomplete snapshots and test failures were reported.
Verification correction
Earlier descriptions overstated correctness and/or test coverage. Those claims are withdrawn. AI-assisted source review has been performed; this is not maintainer approval. Previously mixed build artifacts are not accepted as verification evidence. Corrective changes and clean, targeted verification are in progress; the published head has not yet been replaced.
Published head under review:
bdd5b9647452d4bc207d2b9fe7fe88c2987bd75c.