Skip to content

CASSANDRA-16047: Tolerate missing source components during incremental backup linking - #5149

Open
cheeeee wants to merge 1 commit into
apache:trunkfrom
cheeeee:CASSANDRA-16047-trunk
Open

CASSANDRA-16047: Tolerate missing source components during incremental backup linking#5149
cheeeee wants to merge 1 commit into
apache:trunkfrom
cheeeee:CASSANDRA-16047-trunk

Conversation

@cheeeee

@cheeeee cheeeee commented Sep 10, 2026

Copy link
Copy Markdown

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.

…(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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant