Late, corrected and missing events

This guide tells you what a precomputed feature counts when events arrive late, are corrected, or never arrive, and how to send corrections so that the values stay right.

A feature computed at request time over a table sees the table as it is. A precomputed feature sees what its hook had indexed or computed when it ran. The difference changes what the feature means, and so what a model trained on it learns.

Before you start, know which pattern computes the feature ( Choosing a pattern ), and how its tutorial builds it.

1. Find what your pattern misses

A window read at request time

A window holds what the hook has indexed when the read runs. The read at T counts the members with event_time in (T - 10 minutes, T] that are written by then. It misses a payment when its partition's consumer lags behind the topic, when its producer sent it late, or when the record did not decode and was skipped. A late payment counts in every window that holds its time, once it is indexed ( A late payment ).

A score per event

A score is exact for its record, and for what its sources said when it was computed, at compute_time. The tier it read is the tier when the payment was scored, not when it was paid. A retried record reads its sources again: when the tier changed in between, the second score differs from the first ( At least once ).

A decision per event

A decision sees what is indexed when it runs. It misses a payment of the merchant on a partition another replica has not read yet, or one produced late. The stored decision does not change when that payment arrives ( A decision per payment ).

Buckets

EXPIRE is the one budget for a payment's lateness, the consumer's lag and the wait for a drain together. A payment that arrives, or is picked up, later than its bucket's due time plus EXPIRE is not counted in its bucket ( A payment too late to count ).

  • A bucket is written once it is due, not before. Read a bucket that may not exist yet as missing, or combine buckets with the index for the open part ( Long horizons ).
  • A lost bucket and an empty minute look alike. A minute without payments has no row, and neither does a bucket whose entry expired. A bucket whose correction expired keeps its first value. entries_expired counts the entries dropped: while it stays at zero, a missing row is a minute without payments ( A queue's details ).

Long horizons

A sum that reads hour buckets and the index ( Long horizons ) counts the payments indexed by the request for its edges, and each whole hour's bucket as last computed. It equals the index's sum when every bucket was computed after the last payment of its hour was indexed.

  • A late payment is missing until its bucket runs again. Reads that take its hour from the bucket miss it until the next drain, within EXPIRE, computes the hour again ( A late payment ).
  • A payment later than EXPIRE is missing from its hour for good. The read misses it too: it takes whole hours from the buckets only.

A profile refreshed after activity

A profile computed after each burst counts the payments indexed when its drain runs. Time alone does not refresh it ( Choosing a pattern ).

2. Send corrections as new events

An index assumes that events never change. A record replayed under the same identity rewrites its member from what the statement computes then, with no time fence: a corrected payload is overwritten by an older version replayed later ( Which write lands ). A correction, then a replay shows it.

So do not correct a payment in place. Produce two new events, each with its own identity:

  1. A reversal: a new payment ID, the negated amount, and the original payment's time and merchant.
  2. The corrected payment: another new ID, with the corrected fields.
{"payment_id": 1001, "merchant_id": 7, "amount": 42.50, "event_time": "2026-11-24T10:00:12Z"}
{"payment_id": 9001, "merchant_id": 7, "amount": -42.50, "event_time": "2026-11-24T10:00:12Z"}
{"payment_id": 9002, "merchant_id": 8, "amount": 42.50, "event_time": "2026-11-24T10:00:12Z"}
json

Here payment 1001 moves from merchant 7 to merchant 8. The reversal cancels it in merchant 7's totals, at its original minute. The corrected payment adds it to merchant 8's. Each schedules its own bucket, within EXPIRE.

The features that read the payments must sum amounts, so that a negative amount cancels a positive one. A feature that counts payments needs the reversal flagged, to count it as minus one.

3. Read only final values when you need them

A bucket without late payments is never written again, so its row does not tell final from not corrected yet: its request_time stays at its first run. A bucket is final once it can no longer run: once the clock passes its due time plus EXPIRE, plus the drain's period and lag. A consumer that needs final values, a report or a training label, reads buckets older than that.

Check the result

  • Against batch. Compute the same feature in batch over the same events, once they are all loaded, and compare it with the stored values older than the finality delay. They agree when nothing expired and no event was corrected in place.
  • No lost buckets. entries_expired stays at zero ( Monitor and recover ).

Common mistakes

  • Correcting in place. A payment whose event_time is corrected to another minute moves in the index and schedules the new minute, but the old minute is not scheduled again and keeps counting it. A payment moved to another merchant stays in the old merchant's index until RETENTION trims it. Send a reversal and a new payment instead.
  • Reading a missing bucket as zero. It may be a minute not written yet, or lost. Combine it with the index, or check entries_expired.
  • Training on values younger than the finality delay. Their buckets can still change. Train on what serving saw trains on what was served instead.

Related