Skip to content

CASSANDRA-21649: Ensure SSTable files are deleted in order of last-updated timestamp - #5113

Open
nivykani wants to merge 1 commit into
apache:trunkfrom
nivykani:corrupt-log
Open

CASSANDRA-21649: Ensure SSTable files are deleted in order of last-updated timestamp#5113
nivykani wants to merge 1 commit into
apache:trunkfrom
nivykani:corrupt-log

Conversation

@nivykani

@nivykani nivykani commented Sep 4, 2026

Copy link
Copy Markdown

When a node restarts after crashing, we need to clean up any partially-deleted SSTables, but we do a safety check on REMOVE log records to verify that the last-modified timestamps match the actual files on disk. If the timestamps don’t match, we throw an error that the log is corrupted, and the node doesn’t start.

The comment in LogFile.verifyRecord() states: "Because we delete files from oldest to newest, the latest update time should always match.” But this isn’t always true; regular SSTable deletion after compaction always deletes DATA files first, and doesn’t explicitly set the deletion order of other files.

This patch ensures SSTableTidier deletes files in last-modified order, so the overall timestamp never changes on partial deletes.

The Cassandra Jira

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