psarna/seastar

Initial transactional producer work

Opened this issue · 0 comments

Some of my thoughts/observations (maybe useful?):

Looking at packet captures, it seems that transactional producer initializes itself in such fashion:

  • FindCoordinator packets: It gets the coordinator IP & port (and connects to it?)
  • InitProducerId packet: It sends producer_id (only to coordinator?)

Afterwards, when sending messages using Produce request:

  • AddPartitionsToTxn requests
  • Produce request - sets appropriate fields (transactional_id field) and inside records there is producer_epoch (is this also set?)

Commit or abort: EndTxn request

BTW: Best source for packets specification is: https://github.com/apache/kafka/tree/trunk/clients/src/main/resources/common/message (official Kafka protocol website can be outdated!)

Another area which seems important is "producer epoch", which I think is incremented after each EndTxn or InitProducerId. There is probably some logic to handle this epoch number.

Maybe an intial PR could only implement FindCoordinator + InitProducerId phase?