Skip to content

Commit

Permalink
Merge pull request #613 from twmb/609
Browse files Browse the repository at this point in the history
kgo: pin AddPartitionsToTxn to v3 when using one transaction
  • Loading branch information
twmb authored Nov 1, 2023
2 parents 93c0337 + dc145f4 commit e35a2a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
container: golang:1.21.3
services:
redpanda:
image: vectorized/redpanda-nightly:latest
image: redpandadata/redpanda
ports:
- 9092:9092
env:
Expand Down
15 changes: 11 additions & 4 deletions pkg/kgo/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3420,10 +3420,17 @@ func (cl *addPartitionsToTxnSharder) shard(ctx context.Context, kreq kmsg.Reques

var issues []issueShard
for id, req := range brokerReqs {
issues = append(issues, issueShard{
req: req,
broker: id,
})
if len(req.Transactions) <= 1 || len(req.Transactions) == 1 && !req.Transactions[0].VerifyOnly {
issues = append(issues, issueShard{
req: &pinReq{Request: req, pinMax: true, max: 3},
broker: id,
})
} else {
issues = append(issues, issueShard{
req: req,
broker: id,
})
}
}
for _, unkerr := range unkerrs {
issues = append(issues, issueShard{
Expand Down

0 comments on commit e35a2a1

Please sign in to comment.