Skip to content

Commit

Permalink
app/vmselect/promql: do not use unsafe conversion from bytes slice to…
Browse files Browse the repository at this point in the history
… string when storing a value by map key

The assigned map key shouldn't change over time, otherwise the map won't work properly.

This is a follow-up for 1f91f22
Updates #5087
  • Loading branch information
valyala committed Oct 16, 2023
1 parent a42f188 commit 26adfb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/vmselect/promql/transform.go
Expand Up @@ -419,7 +419,7 @@ func transformBucketsLimit(tfa *transformFuncArg) ([]*timeseries, error) {
mn.CopyFrom(&ts.MetricName)
mn.RemoveTag("le")
b = marshalMetricNameSorted(b[:0], &mn)
k := bytesutil.ToUnsafeString(b)
k := string(b)
m[k] = append(m[k], x{
le: le,
ts: ts,
Expand Down

0 comments on commit 26adfb3

Please sign in to comment.