Skip to content

Commit

Permalink
sink: update metadata when AddPartitionsToTxn fails repeatedly
Browse files Browse the repository at this point in the history
See #239: if we cannot add the partition to the txn, perhaps the broker
died and the txn coordinator moved.
  • Loading branch information
twmb committed Nov 29, 2022
1 parent bc6810d commit 9ee5efa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/kgo/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ func (s *sink) produce(sem <-chan struct{}) bool {
case isRetriableBrokerErr(err) || isDialErr(err):
s.cl.bumpRepeatedLoadErr(err)
s.cl.cfg.logger.Log(LogLevelWarn, "unable to AddPartitionsToTxn due to retriable broker err, bumping client's buffered record load errors by 1 and retrying", "err", err)
s.cl.triggerUpdateMetadata(false, "attempting to refresh transaction coordinator due to failed AddPartitionsToTxn requests")
return moreToDrain || len(req.batches) > 0 // nothing stripped if request-issuing error
default:
// Note that err can be InvalidProducerEpoch, which is
Expand Down

0 comments on commit 9ee5efa

Please sign in to comment.