From 43a000961b9b5090d3da7cc6c22b536cb12d42e8 Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Tue, 27 Apr 2021 18:01:02 -0600 Subject: [PATCH] sink w/ no acks: debug log needs to be before finishBatch --- pkg/kgo/sink.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/kgo/sink.go b/pkg/kgo/sink.go index 731e35e2..a2392c69 100644 --- a/pkg/kgo/sink.go +++ b/pkg/kgo/sink.go @@ -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) }