Quick revision
The short answer
The nodes in the failed data center missed every delete made during the outage. The surviving replicas kept their tombstones for gc_grace_seconds, ten days, and then compaction removed tombstones and data together. When the failed nodes rejoined after two weeks, they still held the old rows with nothing left anywhere to shadow them, so reads and repair treated those rows as live and copied them back: zombie data. A node that has been down longer than gc_grace_seconds must never rejoin as it is; it must be wiped and rebuilt or replaced, and gc_grace_seconds and the repair schedule must be set with long outages in mind.
What to remember
In this answer, we saw that the failed data center missed the deletes, the healthy replicas compacted their tombstones after ten days, and the returning nodes' stale rows were then treated as live and spread by reads and repair. The prevention is a firm rule that nodes down longer than gc_grace_seconds are wiped and rebuilt or replaced, with a gc_grace_seconds and repair schedule that fit realistic outages. Cleanup means re-deleting from an external record of deletes, such as audit logs or deletion events.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
The nodes in the failed data center missed every delete made during the outage. The surviving replicas kept their tombstones for gc_grace_seconds, ten days, and then compaction removed tombstones and data together. When the failed nodes rejoined after two weeks, they still held the old rows with nothing left anywhere to shadow them, so reads and repair treated those rows as live and copied them back: zombie data. A node that has been down longer than gc_grace_seconds must never rejoin as it is; it must be wiped and rebuilt or replaced, and gc_grace_seconds and the repair schedule must be set with long outages in mind.
Why this question is asked
Resurrected data is one of the most alarming Cassandra incidents, because customers see things they deleted, such as cancelled orders or removed personal data, which can also be a privacy problem. It is not a bug in Cassandra but the result of an operational rule that was not followed. Interviewers use this scenario to see whether we understand the interaction between tombstones, gc_grace_seconds and repair well enough to explain the incident and design the runbook that prevents it. In this answer, we will recap how deletes reach replicas, walk through the incident step by step, describe the correct way to bring back a long-dead data center, set gc_grace_seconds and repair policy, and clean up the resurrected records.
1A Quick Recap: How Deletes Reach Every Replica
A delete writes a tombstone, a marker with a timestamp that shadows older data. Like any write, it goes to all replicas, in all data centers, and replicas that are down miss it. Cassandra has three ways to deliver a missed write later: hinted handoff, where the coordinator stores the write and replays it when the node returns, but only for max_hint_window, three hours by default; read repair, which fixes replicas touched by a read; and anti-entropy repair, which compares all data between replicas.
Tombstones are removed by compaction once they are older than gc_grace_seconds. That window exists so that repair has time to deliver every tombstone to every replica first. The rule that follows is simple: every replica must be repaired, or rebuilt, within gc_grace_seconds.
2What Happened, Step by Step
Let us follow one deleted record through the outage.
6 messages in order. Play them, or step through them one at a time.
No tombstone remained anywhere to shadow the stale copy.
On day 0 the second data center goes down. On day 2 a customer deletes order 7731. The write reaches the replicas in the healthy data center, which store a tombstone, while the dead data center's replicas still hold the order. Hints for the dead nodes are kept for three hours and then dropped, so nothing is waiting to deliver the delete.
On day 12, gc_grace_seconds after the delete, the tombstone in the healthy data center becomes eligible for removal, and compaction soon drops both the tombstone and the original order data. At this point the healthy replicas have no trace of order 7731. On day 14 the failed data center is brought back. Its replicas still have order 7731, with an old timestamp, and nothing to shadow it. A read at LOCAL_QUORUM in that data center returns it, read repair copies it to other replicas, and the next anti-entropy repair streams it to the healthy data center, where it now looks like valid data. Every delete made during the outage that passed its gc_grace_seconds comes back the same way.
3The Right Way to Bring Back a Long-Dead Data Center
The prevention rule is firm: a node or data center that has been down longer than gc_grace_seconds must not rejoin with its old data. Its data can no longer be reconciled safely, because the tombstones it needed are gone. Instead, we discard its data and stream fresh copies from the healthy replicas.
The exact procedure depends on the version and whether we keep the node identities, so we follow the documented replace or rebuild steps for our version. What matters is the principle: the returning nodes get their data from replicas that have the correct, compacted history, and they do not serve reads until they have it. Clients must be kept out of the data center while it rebuilds, for example by keeping it out of the driver's local data center configuration and the load balancer.
This also means the runbook for a data center outage needs a clock. When the outage passes a threshold, say seven days with a ten day gc_grace_seconds, the team switches from plan to rejoin to plan to rebuild, and the decision is recorded.
4Setting gc_grace_seconds and the Repair Schedule
gc_grace_seconds should be chosen from two numbers: how often every replica is repaired, and how long a node or data center could plausibly be down before we notice and act. If repairs run every five days and outages of up to two weeks are possible, ten days is not enough for the second case. Raising gc_grace_seconds, for example to 21 days, keeps tombstones longer, which costs disk and some read performance on delete-heavy tables, but gives operators far more room.
Repair itself must actually run. Teams schedule it with Cassandra Reaper or a similar tool, monitor that every table completed a repair within the window, and alert if not. A repair schedule that silently stopped months ago is a frequent root cause of zombie data even without a big outage.
| Node down for | gc_grace_seconds = 10 days | Action |
|---|---|---|
| Under 3 hours | Hints still held | Rejoin; hints replay |
| 3 hours to about 7 days | Tombstones still present | Rejoin, then repair before full traffic |
| Near or past 10 days | Tombstones may be gone | Wipe and rebuild or replace; never rejoin |
5Cleaning Up the Resurrected Records
Once zombies are in the cluster, Cassandra cannot tell them apart from real data, so cleanup needs information from outside the table. The best source is the application's own history: audit logs, a deletion event stream such as OrderDeleted events in Kafka, or a deleted_items table. We collect the keys deleted during the outage window and issue the deletes again, at LOCAL_QUORUM in each data center, now that all replicas are present.
Where no record of deletes exists, we look for indirect signals: rows whose last write timestamp, visible with WRITETIME(column), falls before the outage although related data says they should be gone, such as orders for closed accounts. For personal data the privacy team is involved, because resurrected records may have to be reported. Going forward, application-level checks help, for example treating an order whose customer account is closed as deleted, and keeping a log of deletions makes any future cleanup straightforward.
6Follow-up questions
Could hinted handoff have saved us?
No. Hints are kept only for max_hint_window, three hours by default, and a two-week outage is far beyond that. Raising the window to weeks is not practical, because hints accumulate on the coordinators and replaying them would be slow and heavy. Hints are for short blips; long outages need rebuild.
Why not set gc_grace_seconds very high everywhere?
Tombstones would stay for the whole period, using disk and slowing reads that must skip them, which hurts delete-heavy tables badly. We set it per table: high enough for our repair and outage policy, and lower only for tables written with TTL and no explicit deletes, where replicas expire data on their own.
7Conclusion
In this answer, we saw that the failed data center missed the deletes, the healthy replicas compacted their tombstones after ten days, and the returning nodes' stale rows were then treated as live and spread by reads and repair. The prevention is a firm rule that nodes down longer than gc_grace_seconds are wiped and rebuilt or replaced, with a gc_grace_seconds and repair schedule that fit realistic outages. Cleanup means re-deleting from an external record of deletes, such as audit logs or deletion events.
Open with
This is zombie data. While the second data center was down, every delete was written as a tombstone only in the healthy data center; the failed nodes still had the old rows, and hints for them were dropped after three hours.
Then, if they want more
Ten days after each delete, gc_grace_seconds expired, and compaction in the healthy data center removed both the tombstones and the original data. So when the failed nodes came back after two weeks, they held rows that no tombstone anywhere could shadow, and reads, read repair and the next anti-entropy repair treated them as live and copied them back to everyone.
The rule that prevents it is that a node or data center down longer than gc_grace_seconds must never rejoin with its data. You wipe it and replace it, or bring the nodes up empty, keep clients away, run nodetool rebuild from the healthy data center, then repair before routing traffic.
The outage runbook should switch from rejoin to rebuild well before the window ends. I would also set gc_grace_seconds from our repair interval and realistic outage durations, perhaps raising it to three weeks, and monitor that repairs actually complete with Reaper.
To clean up, I would collect the keys deleted during the outage from audit logs or deletion events, delete them again at quorum, and involve the privacy team if personal data came back.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Apache Cassandra documentation, Amazon DynamoDB developer guide
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "After a data center outage of two weeks, a Cassandra cluster with gc_grace_seconds of 10...": https://scrivio-interview-library.netlify.app/databases/cassandra-and-dynamodb/9ad3272a9d/