Skip to content

CASSANDRA-20800: Updated tombstone note to clarify behavior with TTL and gc_grace_seconds #4289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

bschoening
Copy link
Contributor

Thanks for sending a pull request! Here are some tips if you're new here:

  • Ensure you have added or run the appropriate tests for your PR.
  • Be sure to keep the PR description updated to reflect all changes.
  • Write your PR title to summarize what this PR proposes.
  • If possible, provide a concise example to reproduce the issue for a faster review.
  • Read our contributor guidelines
  • If you're making a documentation change, see our guide to documentation contribution

Commit messages should follow the following format:

<One sentence description, usually Jira title or CHANGES.txt summary>

<Optional lengthier description (context on patch)>

patch by <Authors>; reviewed by <Reviewers> for CASSANDRA-#####

Co-authored-by: Name1 <email1>
Co-authored-by: Name2 <email2>

The Cassandra Jira

@bschoening bschoening requested a review from Copilot August 2, 2025 01:39
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates documentation for Cassandra tombstones to clarify the behavior when TTL (Time-To-Live) values interact with gc_grace_seconds. The change replaces a brief mention of TTL creating tombstones with a more detailed explanation of how expired data behaves during compaction when gc_grace_seconds exceeds the original TTL.

  • Updated the TTL behavior note to explain the expired flag mechanism
  • Clarified the relationship between TTL expiration and gc_grace_seconds
  • Added explanation of when data acts as a tombstone during compaction

After this amount of time has ended, {cassandra} marks the object with a tombstone, and handles it like other tombstoned objects.
You can set a Time-To-Live (TTL) value to a row or column. If the data is compacted after the TTL has expired
but before `gc_grace_seconds` has passed, the data will be written with an expired flag set to True, effectively acting as a tombstone.
This situation arises only when gc_grace_seconds exceeds the original TTL.
Copy link
Preview

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation should clarify what happens in the more common case when TTL is greater than gc_grace_seconds, or when they are equal, to provide a complete picture of TTL behavior.

Suggested change
This situation arises only when gc_grace_seconds exceeds the original TTL.
- If `gc_grace_seconds` exceeds the original TTL, the expired data (tombstone) will be retained until `gc_grace_seconds` elapses, ensuring that deleted data is not resurrected due to late replica synchronization.
- If the TTL is greater than `gc_grace_seconds`, or if they are equal, the tombstone may be eligible for removal as soon as `gc_grace_seconds` has elapsed, which could result in the data being permanently deleted before all replicas have had a chance to synchronize. This increases the risk of deleted data reappearing (zombies) if a replica was down during the grace period.
For safety, it is generally recommended to set `gc_grace_seconds` to a value greater than or equal to the maximum TTL used in the table, to avoid the risk of zombie data.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants