Skip to content

Commit

Permalink
txn & producer: remove two TODOs
Browse files Browse the repository at this point in the history
For txn, the TODO is dependent on the work being supported in Kafka: the
TODO has existed for a long time now and there's nothing that can be
done because Kafka is not supporting it yet.

For producer, not handling concurrent transactions in init producer ID
has never caused problems. It seems rare / likely to happen on client
initialization if it ever does.
  • Loading branch information
twmb committed Mar 1, 2022
1 parent 70aa9f7 commit 3112662
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/kgo/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ func (cl *Client) doInitProducerID(lastID int64, lastEpoch int16) (*producerID,
}

if err = kerr.ErrorForCode(resp.ErrorCode); err != nil {
if kerr.IsRetriable(err) { // TODO handle ConcurrentTransactions collision?
if kerr.IsRetriable(err) { // this could return ConcurrentTransactions, but this is rare; ignore until a user report
cl.cfg.logger.Log(LogLevelInfo, "producer id initialization resulted in retriable error, discarding initialization attempt", "err", err)
return &producerID{lastID, lastEpoch, err}, false
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kgo/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ func (cl *Client) maybeRecoverProducerID() (necessary, did bool, err error) {
}

kip360 := cl.producer.idVersion >= 3 && (errors.Is(ke, kerr.UnknownProducerID) || errors.Is(ke, kerr.InvalidProducerIDMapping))
kip588 := cl.producer.idVersion >= 4 && errors.Is(ke, kerr.InvalidProducerEpoch /* TODO || err == kerr.TransactionTimedOut */)
kip588 := cl.producer.idVersion >= 4 && errors.Is(ke, kerr.InvalidProducerEpoch /* || err == kerr.TransactionTimedOut when implemented in Kafka */)

recoverable := kip360 || kip588
if !recoverable {
Expand Down

0 comments on commit 3112662

Please sign in to comment.