...
- Producer: Determine which broker is the coordinator for its group.
- - Producer: Send a BeginTransaction(producerId, generation, partitions... ) request to the coordinator and await response. We could provide a variation of this API that that also includes a time-out. If the producer needs to commit its consumer state as part of the transaction it will need to include the relevant partition of the __consumer_offsets topic in the BeginTransaction request.
- Broker: Generate a TxId.
- Coordinator: Append a BEGIN(TxId, producerId, generation, partitions...) record to the journal log and send response.
- Producer: Read back response (which will include the TxId).
- Coordinator (and followers): Update in-memory state of in-flight transactions and data partitions of the transaction.
...