AI Agentic Handbook
Chunking & Ingestion

Tombstone

Senior levelReviewed Oct 2026In 2 interview questionsIn 2 posts

A little note saying 'this was deleted', travelling through the system so every copy and index learns to drop it.

In plain English

In a distributed system you cannot always delete something everywhere at once. A tombstone is a small record saying 'this item was deleted, at this time'. It flows through the pipeline like any other change, so each copy, cache and search index learns to drop the item.

Without them, a deleted document can wander back from an old replica and keep turning up in AI answers — which is exactly as awkward as it sounds.

Analogy

Putting a 'withdrawn' slip in the card catalogue instead of quietly removing the book, so branch libraries know to pull their copies too.

Common pitfall

A successful delete API call feels like the end of the story. Vector stores often only mark the row deleted; caches, replicas and backups keep the content until compaction, a TTL, or someone's restore brings it all back.

How it actually works

Tombstones appear at several layers. In Kafka, a record with a key and null value on a compacted topic tells consumers and compaction to delete that key; it stays for delete.retention.ms (24 h default) so slow consumers still see it. In Cassandra and LSM stores, tombstones shadow older values until compaction purges them. In vector indexes, deletes are usually soft: HNSW graphs mark nodes deleted and skip them at query time, Lucene-based engines mark docs in a live-docs bitmap until segment merge, Qdrant flags points and its vacuum optimizer rebuilds segments past a deleted-ratio threshold, and pgvector leaves dead tuples until VACUUM.

In a RAG pipeline: the source delete becomes an event, the Document registry marks the document deleted with a timestamp and its chunk ids, the index deletes those ids, and the Semantic cache invalidates answers that cited them. Soft-deleted vectors still cost RAM and degrade graph quality until Compaction & soft delete. For legal erasure (GDPR Art. 17, one month to respond), you need proof that every copy, including backups' restore path, honours the deletion.

What I'd ship on day one

Deletes as events (Kafka tombstones or explicit op: d), registry deleted_at + chunk ids, delete by id (never by fuzzy filter), purge semantic-cache entries by cited doc id, nightly orphan reconciliation, compaction/vacuum on a deleted-ratio threshold, and a restore runbook that replays registry deletions before serving.

Worked example

Legal matter workspace, a client invokes erasure for 2,300 documents. Events flow: DMS delete → tombstones on docs topic → registry marks deleted_at and lists 31k chunk ids → Qdrant deletes the points (soft) → semantic cache entries citing those ids are purged → nightly reconciliation confirms zero remaining ids. Qdrant's vacuum rebuilds the segment once deleted points pass its threshold, removing them physically. The erasure report lists each document, chunk count and deletion timestamp, plus the backup restore procedure that replays the registry's deletions.

In the interview

Trace a single delete end to end and the answer writes itself: 'source delete → tombstone event → registry deleted_at with chunk ids → index delete → cache invalidation → reconciliation check.' Add that index deletes are soft, so you watch the deleted ratio and compaction, and that for erasure a restore has to replay deletions. Expect exactly that follow-up: 'what happens if you restore last week's backup?' The deleted documents come back, unless the restore replays registry deletions.

Source
Kafka
Registry
Vector index
Answer cache
1
key=doc-77, value=nullSource → Kafka
2
deleted_at, chunk idsKafka → Registry
3
delete 14 chunk idsRegistry → Vector index
4
purge answers citing doc-77Registry → Answer cache
5
soft delete → vacuumVector index → Vector index
A delete is an event that must reach every copy, then be physically compacted.

Numbers worth knowing

Kafka tombstone retention
delete.retention.ms = 24 h defaultcompacted topics; raise if consumers can lag longer
GDPR erasure response window
one month (extendable by two)GDPR Art. 12(3)
Vector-index deleted ratio before compaction
~10–20%typical vacuum thresholds (e.g. Qdrant default 0.2)

How to decide

WhenDo this
Consumers can be offline longer than 24 hRaise delete.retention.ms above the max outage, or tombstones are compacted away unseen.
Deleted ratio in the index passes ~20%Trigger compaction or rebuild; recall and RAM suffer.
Legal erasure appliesRegistry proof per chunk, cache purge, and restore-replay procedure.

Cost maths

Soft-deleted vectors cost RAM until compacted: 20% deleted in a 60 GB index = 12 GB wasted ≈ $60/month at ~$5/GB-month (illustrative). The bigger cost is the incident: an erasure failure under GDPR can draw fines of up to 4% of global annual turnover (Art. 83).

Operating it

Time to scale up when…
  • Deleted ratio above 15% on any shard: schedule compaction
  • Orphan chunks found by reconciliation: fix the delete path
  • Erasure requests above ~100/month: automate the erasure report from the registry
What to monitor
  • Orphan chunks (index ids with no active registry row): alert on any non-zero
  • Deleted ratio per index segment/shard: alert above 15%
  • Tombstone consumer lag vs delete.retention.ms: alert at 50% of retention

When it goes wrong

What users saw

Two months after a firm offboarded a client and deleted their files, the research assistant quoted one of that client's memos.

How it was caught

A lawyer recognised the memo; an audit query found 4,800 chunks with no active registry row.

Root cause

The vector cluster had been restored from a pre-deletion snapshot during an upgrade; nothing replayed deletions after restore.

Fix

Restore runbook now deletes every chunk not active in the registry before traffic; reconciliation pages on any orphan; the semantic cache was flushed.

Sources

  1. Apache Kafka documentation (log compaction) — Apache Software Foundation, 2025docs
  2. Efficient and robust approximate nearest neighbor search using HNSW graphs — Malkov & Yashunin, 2016paper
  3. Debezium documentation — Debezium, 2025docs

Check yourself

Three questions. Every option is explained once you answer.

1ConceptA delete API call on the vector index returns success. Why does the page say the data is not necessarily gone?
2ScenarioDeletes flow as Kafka tombstones on a compacted topic with default settings. A downstream index consumer has had outages of up to 36 hours. What should you change?
3CalculationA 120 GB vector index has 15% soft-deleted vectors awaiting compaction. At ~$5 per GB-month of RAM, what is the monthly cost of the wasted memory?