skip to content

In a RAG ingestion pipeline, why should deletes and permission revocations overtake queued edits, and what makes them cheap to fast-track?

level: middleimportance: should knowfreq 45%

answer

  1. exposure window versus stale text
  2. which stages a delete skips
  3. metadata write, no embedding call
  4. queued edit landing after delete

basics

~20 s

A late edit serves stale text; a late delete or revocation keeps serving content that is gone or that a user may no longer see. Both skip parsing and embedding, so a fast lane costs little more than an index write.

solid answer

~40 s

Most of an edit's lag is parsing and the rate-limited, queued embedding call. A delete or revocation needs neither: removing chunks by document ID and rewriting a chunk's stored access list are metadata writes. So give them their own lane ahead of the embedding queue, and they can reach the index in seconds even while edits wait hours. The cost of lateness is also asymmetric: a stale paragraph is wrong, but a removed document or a revoked share is an exposure window. The fast lane needs one guard: an edit queued earlier for the same document must not land afterwards and bring it back, or re-grant the old access list, so the writer checks the latest tombstone and access list before writing.

code

pseudocode · 22 lines
pseudocode
# illustrative: two lanes and a write-time guard
on change(event):
    if event.kind in [delete, access_change]:
        fast_lane.push(event)            # no parse, no embed
    else:
        edit_lane.push(event)            # parse -> embed -> write

fast_lane worker, for each event:
    if event.kind == delete:
        record_tombstone(event.doc_id, event.source_version)
        remove_chunks(event.doc_id)
    else:
        record_access_list(event.doc_id, event.access_list)
        set_access_list_on_chunks(event.doc_id, event.access_list)

edit_lane writer, after embedding an edit:
    tomb = latest_tombstone(edit.doc_id)
    if tomb exists and tomb.source_version >= edit.source_version:
        drop(edit)                       # deleted after this edit was made
    else:
        acl = latest_access_list(edit.doc_id)   # not edit.access_list
        replace_chunks(edit.doc_id, edit.chunks, acl)

go deeper

for a junior

Recall that deletes and revocations need no parsing or embedding, and that a late one exposes content rather than just serving old text.

for a middle

Explain the separate lane: classify each change at intake, route deletes and access changes ahead of embedding, and record tombstones and the newest access list.

for a senior

Show the resurrection and re-grant traps when a queued edit lands after a delete or revocation, and the write-time check that stops both.

for a principal

Set the lane's target relative to edits for each source, and keep job-driven mass deletes from crowding out the user-driven ones the lane protects.

## Where an edit's lag goes, and why a delete skips most of it An edit to a source document travels the full ingestion path. It is detected, the document is fetched and parsed into text, the text is split into chunks, every changed chunk is sent to an embedding model, and the resulting vectors are written to the vector store. Under load the embedding step is usually the slow one: calls are rate-limited, and changes wait in a queue for their turn. A **delete** or a **permission revocation** needs almost none of that: | Change | Parse | Embed | Write | |---|---|---|---| | Edit | yes, the whole document | yes, every changed chunk | replace the document's chunk set | | Delete | no | no | remove chunks by document ID | | Revocation | no | no | rewrite the access list on existing chunks | Removing chunks by their document ID and rewriting an access list stored as chunk metadata are plain index writes. Many stores can update a chunk's metadata without resending its vector; where one cannot, the stored vector is written back unchanged. Either way no embedding call is made, so these changes can bypass the embedding queue entirely. ## Why lateness costs differ - **A late edit** serves out-of-date text. That is wrong and sometimes harmful, but the content was legitimately visible to that user. - **A late delete** keeps serving a document someone deliberately removed: a withdrawn policy, a retracted announcement, a file posted by mistake. - **A late revocation** keeps showing a document to a user who has just lost access to it, because a share was turned off or a person moved out of a team. The last two are **exposure windows**, not staleness. That asymmetry is why they deserve their own lane and a tighter target, and the lane costs little because these changes skip the expensive stages. ## Building the fast lane 1. **Classify at intake.** When a change arrives from a connector, tag it as edit, delete or access change before anything else happens. 2. **Route deletes and access changes to their own queue**, served by their own workers, ahead of the parse and embed stages. 3. **Write a tombstone** for every delete: the document ID and the source version at which it was deleted. 4. **Keep the newest access list per document** in a small table the edit path can read. 5. **Measure the lane's lag separately.** Its p95 should stay in seconds even while edits wait hours. ## The resurrection trap Overtaking creates one hazard. An edit queued before the delete is still in the slow lane; when it finishes embedding, a naive writer inserts its chunks and **brings the document back**. The same happens with access: an edit queued before a revocation carries the access list captured when it was queued, and writing it **re-grants** access to the reader who just lost it. The fix is a check at write time, shown in the code example. The edit writer looks up the document's latest recorded state, drops the edit if a tombstone at the same or a newer source version exists, and attaches the **newest** recorded access list rather than the one inside the event. That is the general version-guard technique from search-indexing pipelines applied to this lane. The point here is that a fast lane without it trades a slow delete for a reversed one. ## What the lane does not fix The lane only speeds up changes the pipeline already knows about. Noticing that a document was removed at the source belongs to the connector and re-indexing steps, and how long a store takes to stop returning an acknowledged delete is a property of the vector store. A revocation lane also shortens the window rather than closing it: checking permissions again at query time, against the source, is the stronger guard and is covered with retrieval filtering. Many systems filter only on the access list stored with each chunk, which is exactly why that list must be updated first.

  • An edit queued before a share was revoked lands after the revocation. What goes wrong, and how do you stop it?
    Its event carries the access list captured when it was queued, so writing it re-grants access to the reader who just lost it. The edit writer should attach the newest access list recorded for the document, not the one inside the event, and drop the edit entirely if a delete at the same or a newer source version was recorded.
  • If retrieval checks permissions at query time, is a revocation fast lane still needed?
    Usually yes. A query-time check against the source is the stronger guard, but many systems filter only on the access list stored with each chunk, or check only coarse scopes at query time. Wherever the stored list is what enforces access, the fast lane is what keeps the revocation window short.
  • Can the fast lane itself fall behind?
    Rarely from ordinary use, but a mass change can fill it: a whole space un-shared, or a cleanup job deleting thousands of documents. Measure the lane's lag on its own, and consider keeping job-driven bulk deletes apart from the user-driven deletes and revocations the lane exists to protect.

  • Deletes can share the edit queue; they are just another change.
  • A delete has to wait for the embedding stage like an edit does.
  • Once deletes overtake edits, queued edits for that document are harmless.
  • A revocation can safely wait for the next full re-crawl.
  • Query-time permission checks make revocation lag irrelevant in every system.