Skip to content
quarry View Ticket
Login

View Ticket

Reindex loses all progress on restart: checkpoint the cursor per batch

Closedda65feae1ce549133ece0effc747f1a7a194db8cCreated 102.1 days agoUpdated 68.0 days ago
Description2026-08-20 20:49:24
A full reindex streams the entire census through the event bus and folds it batch-by-batch, but the ingest cursor is saved only when the whole round completes. On tcl (42K check-ins, ~240K artifacts) a round takes hours, so any restart during it — deploy, crash, machine sleep — silently resets the rebuild to zero. Observed 2026-08-20: the tcl replay restarted from 1999-era artifacts at least four times in one day, each time losing hours of fold work; the visible frontier sat at Nov 2023 all day while the store held Aug 2026.

Fix shape, either or both: 1. Checkpoint incrementally: persist the frames cursor after every folded batch (the fold is idempotent, so at-least-once replay from a mid-stream checkpoint is already safe). 2. Make rounds short enough that losing one is cheap — bounded frames windows per round.

Invariant this serves: an index rebuild must survive restarts; progress is never hostage to an atomic hours-long unit.

2026-08-21 12:15:00

Moot at the new scale: a lost rebuild costs under a minute, and the first-round tip check re-triggers it automatically. Closing.