console icon indicating copy to clipboard operation
console copied to clipboard

Transaction support

Open larsroholm opened this issue 5 years ago • 5 comments

It would be nice to have support for transactions, so that you can see if a given record was part of a transaction or not, and what the state of the transaction is. Being able to see the transaction id would be a bonus (not to be confused with the transactional id of the producer!).

The information is available in the __transaction_state topic, which is created the first time a producer starts using transactions.

As it stands now, we have no way of telling whether or not a record will be consumed by a consumer running with isolation level ReadComitted.

The information could be displayed in a new column, or we could get an option to filter uncomitted records, or both.

larsroholm avatar Aug 25 '20 10:08 larsroholm

Do you happen to know whether Kafka has an API for this as well? I assume otherwise we'd need to consume the topic on each instance and keep a lot information in RAM (or another persistence) available.

Similar to consumer group offsets the Kafka brokers offer an API to get this information straight from the Brokers.

weeco avatar Aug 25 '20 12:08 weeco

I am not aware of any API that allows you to read that information. We use confluent-kafka-dotnet, which in turn uses librdkafka, and I can't find anything there.

larsroholm avatar Aug 25 '20 12:08 larsroholm

This will be partially fixed with https://github.com/cloudhut/kowl/pull/154 . At least the part that shows whether a message was part of a transaction or not. I'm not sure whether we could track all transaction states as this would make Kowl stateful no? As far as I got that would require consuming the whole transaction state topic?

weeco avatar Dec 18 '20 23:12 weeco

Yup, you would need to consume that topic.

larsroholm avatar Dec 28 '20 22:12 larsroholm

Seems like a DescribeTransactions API will soon be added: https://cwiki.apache.org/confluence/display/KAFKA/KIP-664%3A+Provide+tooling+to+detect+and+abort+hanging+transactions . Worth to wait for I think.

weeco avatar Feb 24 '21 21:02 weeco