Skip to content

Commit

Permalink
sink w/ no acks: debug log needs to be before finishBatch
Browse files Browse the repository at this point in the history
  • Loading branch information
twmb committed Apr 28, 2021
1 parent 948ce3e commit 43a0009
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/kgo/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,10 @@ func (s *sink) handleReqResp(req *produceRequest, resp kmsg.Response, err error)
for partition, batch := range partitions {
batch.owner.mu.Lock()
if batch.isOwnersFirstBatch() {
s.cl.finishBatch(batch.recBatch, req.producerID, req.producerEpoch, partition, 0, nil)
if debug {
fmt.Fprintf(b, "%d{%d=>%d}, ", partition, 0, len(batch.records))
fmt.Fprintf(b, "%d{0=>%d}, ", partition, len(batch.records))
}
s.cl.finishBatch(batch.recBatch, req.producerID, req.producerEpoch, partition, 0, nil)
} else if debug {
fmt.Fprintf(b, "%d{skipped}, ", partition)
}
Expand Down

0 comments on commit 43a0009

Please sign in to comment.