diff --git a/app/vmselect/netstorage/netstorage.go b/app/vmselect/netstorage/netstorage.go index 9d715fee1e..de67195d23 100644 --- a/app/vmselect/netstorage/netstorage.go +++ b/app/vmselect/netstorage/netstorage.go @@ -1085,11 +1085,12 @@ func (tbfw *tmpBlocksFileWrapper) RegisterAndWriteBlock(mb *storage.MetricBlock) tmpBufPool.Put(bb) if err == nil { metricName := mb.MetricName - addrs := tbfw.m[string(metricName)] + metricNameStrUnsafe := bytesutil.ToUnsafeString(metricName) + addrs := tbfw.m[metricNameStrUnsafe] addrs = append(addrs, addr) if len(addrs) > 1 { // An optimization: avoid memory allocation and copy for already existing metricName key in tbfw.m. - tbfw.m[string(metricName)] = addrs + tbfw.m[metricNameStrUnsafe] = addrs } else { // An optimization for big number of time series with long names: store only a single copy of metricNameStr // in both tbfw.orderedMetricNames and tbfw.m.