You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was more complicated than I was anticipating -- kgo is not designed
to have partition movement *outside* of the metadata loop.
Tested against producing to / consuming from kfake, moving a partition
every second.
s.cl.cfg.logger.Log(LogLevelError, "broker erroneously replied with topic in produce request that we did not produce to", "broker", logID(s.nodeID), "topic", topic)
s.cl.cfg.logger.Log(LogLevelError, "broker erroneously replied with partition in produce request that we did not produce to", "broker", logID(s.nodeID), "topic", rTopic.Topic, "partition", partition)
628
+
s.cl.cfg.logger.Log(LogLevelError, "broker erroneously replied with partition in produce request that we did not produce to", "broker", logID(s.nodeID), "topic", rt.Topic, "partition", partition)
s.cl.cfg.logger.Log(LogLevelError, "broker did not reply to all topics / partitions in the produce request! reenqueuing missing partitions", "broker", logID(s.nodeID))
663
-
s.handleRetryBatches(req.batches, 0, true, false, "broker did not reply to all topics in produce request")
666
+
s.handleRetryBatches(req.batches, nil, 0, true, false, "broker did not reply to all topics in produce request")
664
667
}
665
668
iflen(reqRetry) >0 {
666
-
s.handleRetryBatches(reqRetry, 0, true, true, "produce request had retry batches")
669
+
s.handleRetryBatches(reqRetry, &kmove, 0, true, true, "produce request had retry batches")
667
670
}
668
671
}
669
672
670
673
func (s*sink) handleReqRespBatch(
671
674
b*bytes.Buffer,
675
+
kmove*kip951move,
676
+
resp*kmsg.ProduceResponse,
672
677
topicstring,
673
-
partitionint32,
678
+
rp*kmsg.ProduceResponseTopicPartition,
674
679
batchseqRecBatch,
675
680
producerIDint64,
676
681
producerEpochint16,
677
-
baseOffsetint64,
678
-
errorCodeint16,
679
682
) (retry, didProducebool) {
680
683
batch.owner.mu.Lock()
681
684
deferbatch.owner.mu.Unlock()
@@ -684,25 +687,25 @@ func (s *sink) handleReqRespBatch(
684
687
685
688
debug:=b!=nil
686
689
ifdebug {
687
-
fmt.Fprintf(b, "%d{", partition)
690
+
fmt.Fprintf(b, "%d{", rp.Partition)
688
691
}
689
692
690
693
// We only ever operate on the first batch in a record buf. Batches
691
694
// work sequentially; if this is not the first batch then an error
692
695
// happened and this later batch is no longer a part of a seq chain.
@@ -799,7 +812,7 @@ func (s *sink) handleReqRespBatch(
799
812
s.cl.cfg.logger.Log(LogLevelInfo, fmt.Sprintf("batch errored with %s, failing the producer ID and resetting all sequence numbers", err.(*kerr.Error).Message),
800
813
"broker", logID(s.nodeID),
801
814
"topic", topic,
802
-
"partition", partition,
815
+
"partition", rp.Partition,
803
816
"producer_id", producerID,
804
817
"producer_epoch", producerEpoch,
805
818
"err", err,
@@ -811,15 +824,15 @@ func (s *sink) handleReqRespBatch(
0 commit comments