Skip to content

Commit

Permalink
consumer group bugfix: map needs to be one block lower
Browse files Browse the repository at this point in the history
topicOffsets is meant to track per-topic offsets when updating
uncommitted. Thus, we want to have the maps existence be per-topic.

The prior location had the map per fetch, and would reuse that map
across all topics within a fetch.
  • Loading branch information
twmb committed Apr 8, 2021
1 parent 009e1ba commit 71c6109
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kgo/consumer_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -1433,13 +1433,13 @@ func (g *groupConsumer) updateUncommitted(fetches Fetches) {
defer g.mu.Unlock()

for _, fetch := range fetches {
var topicOffsets map[int32]uncommit
for _, topic := range fetch.Topics {

if g.cl.cfg.logger.Level() >= LogLevelDebug {
fmt.Fprintf(&b, "%s[", topic.Topic)
}

var topicOffsets map[int32]uncommit
for _, partition := range topic.Partitions {
if len(partition.Records) == 0 {
continue
Expand Down

0 comments on commit 71c6109

Please sign in to comment.