mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/storage: fix metric name match for composite filter
This commit is contained in:
parent
c7dccebaef
commit
fcb7655d1e
1 changed files with 5 additions and 1 deletions
|
@ -1885,6 +1885,10 @@ func (is *indexSearch) updateMetricIDsByMetricNameMatch(metricIDs, srcMetricIDs
|
|||
// sort srcMetricIDs in order to speed up Seek below.
|
||||
sortedMetricIDs := srcMetricIDs.AppendTo(nil)
|
||||
|
||||
kb := &is.kb
|
||||
kb.B = marshalCommonPrefix(kb.B[:0], nsPrefixTagToMetricIDs)
|
||||
tfs = fromCompositeTagFilters(tfs, kb.B)
|
||||
|
||||
metricName := kbPool.Get()
|
||||
defer kbPool.Put(metricName)
|
||||
mn := GetMetricName()
|
||||
|
@ -2115,6 +2119,7 @@ func fromCompositeTagFilters(tfs []*tagFilter, prefix []byte) []*tagFilter {
|
|||
}
|
||||
tagKey = tagKey[nameLen:]
|
||||
tfNew := *tf
|
||||
tfNew.key = append(tfNew.key[:0], tagKey...)
|
||||
tfNew.prefix = append(tfNew.prefix[:0], prefix...)
|
||||
tfNew.prefix = marshalTagValue(tfNew.prefix, tagKey)
|
||||
tfNew.prefix = append(tfNew.prefix, tail...)
|
||||
|
@ -2125,7 +2130,6 @@ func fromCompositeTagFilters(tfs []*tagFilter, prefix []byte) []*tagFilter {
|
|||
|
||||
func matchTagFilters(mn *MetricName, tfs []*tagFilter, kb *bytesutil.ByteBuffer) (bool, error) {
|
||||
kb.B = marshalCommonPrefix(kb.B[:0], nsPrefixTagToMetricIDs)
|
||||
tfs = fromCompositeTagFilters(tfs, kb.B)
|
||||
for i, tf := range tfs {
|
||||
if bytes.Equal(tf.key, graphiteReverseTagKey) {
|
||||
// Skip artificial tag filter for Graphite-like metric names with dots,
|
||||
|
|
Loading…
Reference in a new issue