Skip to content

Commit 9e32bf9

Browse files
committedJun 8, 2024·
kgo: ignore aborted txns if using READ_UNCOMMITTED
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.
1 parent c64c3d3 commit 9e32bf9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎pkg/kgo/source.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,10 @@ func (o *cursorOffsetNext) processRespPartition(br *broker, rp *kmsg.FetchRespon
11921192
o.hwm = rp.HighWatermark
11931193
}
11941194

1195-
aborter := buildAborter(rp)
1195+
var aborter aborter
1196+
if br.cl.cfg.isolationLevel == 1 {
1197+
aborter = buildAborter(rp)
1198+
}
11961199

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

0 commit comments

Comments
 (0)
Please sign in to comment.