mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
lib/storage: skip metricID if the corresponding metricID->metricName is missing in inverted index during search
This case is possible when the corresponding metricID->metricName entry didn't propagate to inverted index yet. This should fix the following error: error when searching tsids for tfss [...]: cannot find metricName by metricID 1582417212213420669: EOF
This commit is contained in:
parent
8a25c1ed71
commit
c1de3f67b4
1 changed files with 5 additions and 0 deletions
|
@ -1362,6 +1362,11 @@ func (is *indexSearch) updateMetricIDsByMetricNameMatch(metricIDs, srcMetricIDs
|
||||||
var err error
|
var err error
|
||||||
metricName.B, err = is.searchMetricName(metricName.B[:0], metricID)
|
metricName.B, err = is.searchMetricName(metricName.B[:0], metricID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err == io.EOF {
|
||||||
|
// It is likely the metricID->metricName entry didn't propagate to inverted index yet.
|
||||||
|
// Skip this metricID for now.
|
||||||
|
continue
|
||||||
|
}
|
||||||
return fmt.Errorf("cannot find metricName by metricID %d: %s", metricID, err)
|
return fmt.Errorf("cannot find metricName by metricID %d: %s", metricID, err)
|
||||||
}
|
}
|
||||||
if err := mn.Unmarshal(metricName.B); err != nil {
|
if err := mn.Unmarshal(metricName.B); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue