Skip to content

Commit 05c9958

Browse files
authored
Ensure Cassandra bucket number is not negative (#599)
1 parent 6baabac commit 05c9958

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugin/storage/cassandra/spanstore/writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func (s *SpanWriter) indexByDuration(span *dbmodel.Span, startTime time.Time) er
198198
}
199199

200200
func (s *SpanWriter) indexByService(traceID model.TraceID, span *dbmodel.Span) error {
201-
bucketNo := span.SpanHash % defaultNumBuckets
201+
bucketNo := uint64(span.SpanHash) % defaultNumBuckets
202202
query := s.session.Query(serviceNameIndex)
203203
q := query.Bind(span.Process.ServiceName, bucketNo, span.StartTime, span.TraceID)
204204
return s.writerMetrics.serviceNameIndex.Exec(q, s.logger)

0 commit comments

Comments
 (0)