Skip to content

Commit

Permalink
fix(kafka): Fixes partition selection in distributors (#14242)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyriltovena authored Sep 24, 2024
1 parent b6e9945 commit 3f47233
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -901,12 +901,11 @@ func (d *Distributor) sendStreamToKafka(ctx context.Context, stream KeyedStream,
if len(stream.Stream.Entries) == 0 {
return nil
}
/* partitionID, err := d.partitionRing.PartitionRing().ActivePartitionForKey(stream.HashKey)
if err != nil {
d.kafkaAppends.WithLabelValues("kafka", "fail").Inc()
return fmt.Errorf("failed to find active partition for stream: %w", err)
}*/
partitionID := int32(0)
partitionID, err := d.partitionRing.PartitionRing().ActivePartitionForKey(stream.HashKey)
if err != nil {
d.kafkaAppends.WithLabelValues("kafka", "fail").Inc()
return fmt.Errorf("failed to find active partition for stream: %w", err)
}

startTime := time.Now()

Expand Down

0 comments on commit 3f47233

Please sign in to comment.