mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
app/vmselect/netstorage: do not query Go maps with unsafe string keys, since this breaks in Go 1.17
This commit is contained in:
parent
192dfbfd90
commit
74ffaa45d9
1 changed files with 2 additions and 4 deletions
|
@ -1032,15 +1032,13 @@ func ProcessSearchQuery(sq *storage.SearchQuery, fetchData bool, deadline search
|
|||
return nil, fmt.Errorf("cannot write %d bytes to temporary file: %w", len(buf), err)
|
||||
}
|
||||
metricName := sr.MetricBlockRef.MetricName
|
||||
metricNameStrUnsafe := bytesutil.ToUnsafeString(metricName)
|
||||
brs := m[metricNameStrUnsafe]
|
||||
brs := m[string(metricName)]
|
||||
brs = append(brs, blockRef{
|
||||
partRef: br.PartRef(),
|
||||
addr: addr,
|
||||
})
|
||||
if len(brs) > 1 {
|
||||
// An optimization: do not allocate a string for already existing metricName key in m
|
||||
m[metricNameStrUnsafe] = brs
|
||||
m[string(metricName)] = brs
|
||||
} else {
|
||||
// An optimization for big number of time series with long metricName values:
|
||||
// use only a single copy of metricName for both orderedMetricNames and m.
|
||||
|
|
Loading…
Reference in a new issue