Skip to content

Commit

Permalink
kgo: ignore aborted txns if using READ_UNCOMMITTED
Browse files Browse the repository at this point in the history
Kafka does not return AbortedTransactions in the fetch response if the
client is using read uncommitted, so kgo works perfectly against Kafka.
Redpanda DOES return AbortedTransactions (today, although this is being
changed) even if the client is using READ_UNCOMMITTED, which causes
records to be skipped. Redpanda is changing, but we can address this in
kgo as well.
  • Loading branch information
twmb committed Jun 8, 2024
1 parent c64c3d3 commit 9e32bf9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/kgo/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,10 @@ func (o *cursorOffsetNext) processRespPartition(br *broker, rp *kmsg.FetchRespon
o.hwm = rp.HighWatermark
}

aborter := buildAborter(rp)
var aborter aborter
if br.cl.cfg.isolationLevel == 1 {
aborter = buildAborter(rp)
}

// A response could contain any of message v0, message v1, or record
// batches, and this is solely dictated by the magic byte (not the
Expand Down

0 comments on commit 9e32bf9

Please sign in to comment.