KIP-904 — Kafka Streams - Guarantee subtractor is called before adder if
Accepted Kafka 3.5 Streams
KIP-904 changes `KTable.groupBy()` to emit a single combined event when the grouping key is unchanged (carrying both the old and new value together) instead of two separate tombstone/insert events, guaranteeing the subtractor is applied before the adder in the downstream aggregate. With the two-event approach, a stream-table join could observe the intermediate state after the subtractor fires but before the adder fires, producing a transiently inconsistent aggregate value that is visible to downstream consumers.
Details
| Author | Farooq Qaiser |
| Status | Accepted |
| Kafka Version | 3.5 |
| JIRA | KAFKA-12446 |
| Wiki | View on Apache Wiki |
| Created | 2023-02-05 |
| Last Modified | 2023-04-15 |
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.