mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
Compare commits
6 Commits
weakpointe
...
test-codec
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
499d3e519c | ||
|
|
c33652431c | ||
|
|
bb593c3e0c | ||
|
|
b6607c2c12 | ||
|
|
4c99e7e183 | ||
|
|
80101515b8 |
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@@ -91,7 +91,6 @@ jobs:
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
files: ./coverage.txt
|
||||
fail_ci_if_error: false
|
||||
|
||||
integration-test:
|
||||
name: integration-test
|
||||
|
||||
9
codecov.yml
Normal file
9
codecov.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
# see https://docs.codecov.com/docs/common-recipe-list#set-non-blocking-status-checks
|
||||
coverage:
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
informational: true
|
||||
patch:
|
||||
default:
|
||||
informational: true
|
||||
@@ -21,6 +21,8 @@ See also [LTS releases](https://docs.victoriametrics.com/victoriametrics/lts-rel
|
||||
* SECURITY: upgrade Go builder from Go1.24.3 to Go1.24.4. See [the list of issues addressed in Go1.24.4](https://github.com/golang/go/issues?q=milestone%3AGo1.24.4+label%3ACherryPickApproved).
|
||||
* SECURITY: upgrade base docker image (Alpine) from 3.21.3 to 3.22.0. See [Alpine 3.22.0 release notes](https://alpinelinux.org/posts/Alpine-3.22.0-released.html).
|
||||
|
||||
* BUGFIX: [vmsingle](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/) and `vmstorage` in [VictoriaMetrics cluster](https://docs.victoriametrics.com/victoriametrics/cluster-victoriametrics/): fix incorrect sorting of tag filters. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/9127) for details.
|
||||
|
||||
## [v1.119.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.119.0)
|
||||
|
||||
Released at 2025-06-06
|
||||
|
||||
@@ -295,7 +295,7 @@ func (tf *tagFilter) Less(other *tagFilter) bool {
|
||||
// Move composite filters to the top, since they usually match lower number of time series.
|
||||
// Move regexp filters to the bottom, since they require scanning all the entries for the given label.
|
||||
isCompositeA := tf.isComposite()
|
||||
isCompositeB := tf.isComposite()
|
||||
isCompositeB := other.isComposite()
|
||||
if isCompositeA != isCompositeB {
|
||||
return isCompositeA
|
||||
}
|
||||
|
||||
@@ -1289,3 +1289,118 @@ func TestTagFiltersAddEmpty(t *testing.T) {
|
||||
t.Fatalf("missing added filter")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTagFilterLess(t *testing.T) {
|
||||
// Create helper function f to execute and verify Less method results
|
||||
f := func(tf1, tf2 *tagFilter, expected bool) {
|
||||
t.Helper()
|
||||
|
||||
result := tf1.Less(tf2)
|
||||
if result != expected {
|
||||
t.Fatalf("unexpected Less result: got %v, want %v for %v.Less(%v)",
|
||||
result, expected, tf1, tf2)
|
||||
}
|
||||
}
|
||||
|
||||
// Test composite filters come first
|
||||
compositeFilter := &tagFilter{
|
||||
key: []byte{compositeTagKeyPrefix, 'c', 'o', 'm', 'p', 'o', 's', 'i', 't', 'e'},
|
||||
matchCost: 20,
|
||||
isRegexp: false,
|
||||
orSuffixes: []string{},
|
||||
}
|
||||
normalFilter := &tagFilter{
|
||||
key: []byte("normal"),
|
||||
matchCost: 10, // Although matchCost is smaller, composite filter should come first
|
||||
isRegexp: false,
|
||||
orSuffixes: []string{},
|
||||
}
|
||||
f(compositeFilter, normalFilter, true)
|
||||
f(normalFilter, compositeFilter, false)
|
||||
|
||||
// Test lower matchCost comes first (when neither is composite)
|
||||
lowCost := &tagFilter{
|
||||
key: []byte("key1"),
|
||||
matchCost: 5,
|
||||
isRegexp: false,
|
||||
orSuffixes: []string{},
|
||||
}
|
||||
highCost := &tagFilter{
|
||||
key: []byte("key1"),
|
||||
matchCost: 15,
|
||||
isRegexp: false,
|
||||
orSuffixes: []string{},
|
||||
}
|
||||
f(lowCost, highCost, true)
|
||||
f(highCost, lowCost, false)
|
||||
|
||||
// Test non-regexp filters come first
|
||||
nonRegexp := &tagFilter{
|
||||
key: []byte("key2"),
|
||||
matchCost: 10,
|
||||
isRegexp: false,
|
||||
orSuffixes: []string{},
|
||||
}
|
||||
regexp := &tagFilter{
|
||||
key: []byte("key2"),
|
||||
matchCost: 10,
|
||||
isRegexp: true,
|
||||
orSuffixes: []string{},
|
||||
}
|
||||
f(nonRegexp, regexp, true)
|
||||
f(regexp, nonRegexp, false)
|
||||
|
||||
// Test fewer orSuffixes come first
|
||||
fewSuffixes := &tagFilter{
|
||||
key: []byte("key3"),
|
||||
matchCost: 10,
|
||||
isRegexp: false,
|
||||
orSuffixes: []string{"a"},
|
||||
}
|
||||
manySuffixes := &tagFilter{
|
||||
key: []byte("key3"),
|
||||
matchCost: 10,
|
||||
isRegexp: false,
|
||||
orSuffixes: []string{"a", "b"},
|
||||
}
|
||||
f(fewSuffixes, manySuffixes, true)
|
||||
f(manySuffixes, fewSuffixes, false)
|
||||
|
||||
// Test non-negative filters come first
|
||||
nonNegative := &tagFilter{
|
||||
key: []byte("key4"),
|
||||
matchCost: 10,
|
||||
isRegexp: false,
|
||||
orSuffixes: []string{},
|
||||
isNegative: false,
|
||||
}
|
||||
negative := &tagFilter{
|
||||
key: []byte("key4"),
|
||||
matchCost: 10,
|
||||
isRegexp: false,
|
||||
orSuffixes: []string{},
|
||||
isNegative: true,
|
||||
}
|
||||
f(nonNegative, negative, true)
|
||||
f(negative, nonNegative, false)
|
||||
|
||||
// Test lower lexicographical prefix comes first
|
||||
prefixA := &tagFilter{
|
||||
key: []byte("key5"),
|
||||
matchCost: 10,
|
||||
isRegexp: false,
|
||||
orSuffixes: []string{},
|
||||
isNegative: false,
|
||||
prefix: []byte("aaa"),
|
||||
}
|
||||
prefixB := &tagFilter{
|
||||
key: []byte("key5"),
|
||||
matchCost: 10,
|
||||
isRegexp: false,
|
||||
orSuffixes: []string{},
|
||||
isNegative: false,
|
||||
prefix: []byte("bbb"),
|
||||
}
|
||||
f(prefixA, prefixB, true)
|
||||
f(prefixB, prefixA, false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user