mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 08:23:34 +01:00
lib/storage: handle errors returned from TagFilters.Add
when cloning TagFilters with negative filter
This commit is contained in:
parent
5270b7a097
commit
504ea876f2
@ -94,9 +94,13 @@ func (tfs *TagFilters) cloneWithNegativeFilter(tfNegative *tagFilter) *TagFilter
|
||||
for i := range tfs.tfs {
|
||||
tf := &tfs.tfs[i]
|
||||
if tf == tfNegative {
|
||||
tfsNew.Add(tf.key, []byte(".+"), true, true)
|
||||
if err := tfsNew.Add(tf.key, []byte(".+"), true, true); err != nil {
|
||||
logger.Panicf("BUG: unexpected error when creating a tag filter key=~'.+': %s", err)
|
||||
}
|
||||
} else {
|
||||
tfsNew.Add(tf.key, tf.value, tf.isNegative, tf.isRegexp)
|
||||
if err := tfsNew.Add(tf.key, tf.value, tf.isNegative, tf.isRegexp); err != nil {
|
||||
logger.Panicf("BUG: unexpected error when cloning a tag filter %s: %s", tf, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return tfsNew
|
||||
|
Loading…
Reference in New Issue
Block a user