A key helps choose a Kafka partition. It does not by itself prove the business order in which an external projection commits updates. Kafka orders records within a partition, while producers, routing changes and asynchronous sink work can introduce different boundaries. First determine which order was actually lost.

One possible cause is a partition-count change: the older keyed event may be in one partition, while a producer using the new partitioning maps the same key elsewhere. Each partition remains ordered, but there is no total order between them. Another possibility is that records were consumed in order from one partition and asynchronous workers completed their writes in reverse. Inspect producer ordering and retry settings too. Kafka’s documentation states the per-partition boundary, and its operations guidance warns that added partitions can change key placement. The prompt alone cannot establish which cause occurred.

I would inspect topic partition counts over time, producer partitioner versions, message keys, source revisions, partition and offset of both events, and the order of successful writes to the projection. A later arrival is not necessarily a later business state. Source timestamps alone can be unreliable if clocks differ or retries reuse payloads. If the source owns a monotonic per-entity revision or a comparable change-log position, carry it with each event and make the sink update conditional: apply revision 12 only if the stored revision is below 12. The exact ordering field must come from the same source authority for both events. Kafka offsets from different partitions are not directly comparable. For a hypothetical source revision 12 followed by 13, the sink must atomically apply 13 only over an older accepted revision, then reject a late full-state revision 12. A separate read followed by an unconditional write is still vulnerable to two workers racing. If events are partial patches rather than full state, global stale-revision rejection can discard an independent field update. Preserve source order, reconstruct complete authoritative state, or use a justified per-field version protocol.

What if we cannot change the producer or source? Freeze the partitioning scheme for the ordered stream, introduce an explicit repartitioned topic by stable key with a controlled cutover, or serialize updates through a stateful authority. But a new topic alone cannot retroactively infer the order between in-flight events from old and new partitions. You need a source version, a drain barrier, or a source-of-truth reconciliation. The projection should expose stale-write rejection and lag metrics, with a repair path for entities already overwritten.

Test a partition expansion while one old update is delayed, then deliver the newer update first. Check the final state and source revision, not just the order in one consumer log. One database transaction updated two tables. Why did the AI report see only half of it? asks whether one source transaction is applied partially across tables. This question is about two valid updates to one entity whose business order was lost through producer behavior, routing changes or asynchronous projection writes.