app/vmselect/promql: follow-up for 896c85a4a4

- Clarify the description of the change at docs/CHANGELOG.md
- Make sure that bitmap_*(X, NaN) returns NaN

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4996
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5021
This commit is contained in:
Aliaksandr Valialkin 2023-10-02 20:06:46 +02:00
parent 7bb5f75a2a
commit 5fd79f47f1
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1
3 changed files with 14 additions and 10 deletions

View File

@ -259,8 +259,12 @@ func TestExecSuccess(t *testing.T) {
t.Run("bitmap_and(NaN, 1)", func(t *testing.T) { t.Run("bitmap_and(NaN, 1)", func(t *testing.T) {
t.Parallel() t.Parallel()
q := `bitmap_and(NaN, 1)` q := `bitmap_and(NaN, 1)`
var resultExpected []netstorage.Result f(q, nil)
f(q, resultExpected) })
t.Run("bitmap_and(1, NaN)", func(t *testing.T) {
t.Parallel()
q := `bitmap_and(1, NaN)`
f(q, nil)
}) })
t.Run("bitmap_and(round(rand(1) > 0.5, 1), 1)", func(t *testing.T) { t.Run("bitmap_and(round(rand(1) > 0.5, 1), 1)", func(t *testing.T) {
t.Parallel() t.Parallel()
@ -298,8 +302,7 @@ func TestExecSuccess(t *testing.T) {
t.Run("bitmap_or(NaN, 1)", func(t *testing.T) { t.Run("bitmap_or(NaN, 1)", func(t *testing.T) {
t.Parallel() t.Parallel()
q := `bitmap_or(NaN, 1)` q := `bitmap_or(NaN, 1)`
var resultExpected []netstorage.Result f(q, nil)
f(q, resultExpected)
}) })
t.Run("bitmap_or(round(rand(1) > 0.5, 1), 1)", func(t *testing.T) { t.Run("bitmap_or(round(rand(1) > 0.5, 1), 1)", func(t *testing.T) {
t.Parallel() t.Parallel()
@ -337,8 +340,7 @@ func TestExecSuccess(t *testing.T) {
t.Run("bitmap_xor(NaN, 1)", func(t *testing.T) { t.Run("bitmap_xor(NaN, 1)", func(t *testing.T) {
t.Parallel() t.Parallel()
q := `bitmap_xor(NaN, 1)` q := `bitmap_xor(NaN, 1)`
var resultExpected []netstorage.Result f(q, nil)
f(q, resultExpected)
}) })
t.Run("bitmap_xor(round(rand(1) > 0.5, 1), 1)", func(t *testing.T) { t.Run("bitmap_xor(round(rand(1) > 0.5, 1), 1)", func(t *testing.T) {
t.Parallel() t.Parallel()

View File

@ -2590,10 +2590,12 @@ func newTransformBitmap(bitmapFunc func(a, b uint64) uint64) func(tfa *transform
} }
tf := func(values []float64) { tf := func(values []float64) {
for i, v := range values { for i, v := range values {
if math.IsNaN(v) { w := ns[i]
continue result := nan
if !math.IsNaN(v) && !math.IsNaN(w) {
result = float64(bitmapFunc(uint64(v), uint64(w)))
} }
values[i] = float64(bitmapFunc(uint64(v), uint64(ns[i]))) values[i] = result
} }
} }
return doTransformValues(args[0], tf, tfa.fe) return doTransformValues(args[0], tf, tfa.fe)

View File

@ -54,13 +54,13 @@ The sandbox cluster installation is running under the constant load generated by
* FEATURE: limit the length of string params in log messages to 500 chars. Longer string params are replaced with the `first_250_chars..last_250_chars`. This prevents from too long log lines, which can be emitted by VictoriaMetrics components. * FEATURE: limit the length of string params in log messages to 500 chars. Longer string params are replaced with the `first_250_chars..last_250_chars`. This prevents from too long log lines, which can be emitted by VictoriaMetrics components.
* FEATURE: [docker compose environment](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/deployment/docker): add `vmauth` component to cluster's docker-compose example for balancing load among multiple `vmselect` components. * FEATURE: [docker compose environment](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/deployment/docker): add `vmauth` component to cluster's docker-compose example for balancing load among multiple `vmselect` components.
* FEATURE: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): make sure that `q2` series are returned after `q1` series in the results of `q1 or q2` query, in the same way as Prometheus does. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4763). * FEATURE: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): make sure that `q2` series are returned after `q1` series in the results of `q1 or q2` query, in the same way as Prometheus does. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4763).
* FEATURE: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): return empty result from [`bitmap_and(a, b)`](https://docs.victoriametrics.com/MetricsQL.html#bitmap_and), [`bitmap_or(a, b)`](https://docs.victoriametrics.com/MetricsQL.html#bitmap_or) and [`bitmap_xor(a, b)`](https://docs.victoriametrics.com/MetricsQL.html#bitmap_xor) if `a` or `b` have no value at the particular timestamp. Previously `0` was returned in this case. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4996).
* FEATURE: stop exposing `vm_merge_need_free_disk_space` metric, since it has been appeared that it confuses users while doesn't bring any useful information. See [this comment](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/686#issuecomment-1733844128). * FEATURE: stop exposing `vm_merge_need_free_disk_space` metric, since it has been appeared that it confuses users while doesn't bring any useful information. See [this comment](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/686#issuecomment-1733844128).
* BUGFIX: [Official Grafana dashboards for VictoriaMetrics](https://grafana.com/orgs/victoriametrics): fix display of ingested rows rate for `Samples ingested/s` and `Samples rate` panels for vmagent's dasbhoard. Previously, not all ingested protocols were accounted in these panels. An extra panel `Rows rate` was added to `Ingestion` section to display the split for rows ingested rate by protocol. * BUGFIX: [Official Grafana dashboards for VictoriaMetrics](https://grafana.com/orgs/victoriametrics): fix display of ingested rows rate for `Samples ingested/s` and `Samples rate` panels for vmagent's dasbhoard. Previously, not all ingested protocols were accounted in these panels. An extra panel `Rows rate` was added to `Ingestion` section to display the split for rows ingested rate by protocol.
* BUGFIX: [Official Grafana dashboards for VictoriaMetrics](https://grafana.com/orgs/victoriametrics): move vmagent's `Concurrent inserts` panel to Troubleshooting section from `Ingestion` section because this panel is related to both: scraped and ingested data. Before, it could have give a misleading impression that it is related to ingested metrics only. * BUGFIX: [Official Grafana dashboards for VictoriaMetrics](https://grafana.com/orgs/victoriametrics): move vmagent's `Concurrent inserts` panel to Troubleshooting section from `Ingestion` section because this panel is related to both: scraped and ingested data. Before, it could have give a misleading impression that it is related to ingested metrics only.
* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix the bug causing render looping when switching to heatmap. * BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix the bug causing render looping when switching to heatmap.
* BUGFIX: [VictoriaMetrics enterprise](https://docs.victoriametrics.com/enterprise.html) validate `-dedup.minScrapeInterval` value and `-downsampling.period` intervals are multiples of each other. See [these docs](https://docs.victoriametrics.com/#downsampling). * BUGFIX: [VictoriaMetrics enterprise](https://docs.victoriametrics.com/enterprise.html) validate `-dedup.minScrapeInterval` value and `-downsampling.period` intervals are multiples of each other. See [these docs](https://docs.victoriametrics.com/#downsampling).
* BUGFIX: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): fix bitmap_*() functions behavior. These functions will return `NaN` if timeseries has no value for timestamp. Previously these functions return `0`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4996).
* BUGFIX: [vmbackup](https://docs.victoriametrics.com/vmbackup.html): properly copy `appliedRetention.txt` files inside `<-storageDataPath>/{data}` folders during [incremental backups](https://docs.victoriametrics.com/vmbackup.html#incremental-backups). Previously the new `appliedRetention.txt` could be skipped during incremental backups, which could lead to increased load on storage after restoring from backup. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5005). * BUGFIX: [vmbackup](https://docs.victoriametrics.com/vmbackup.html): properly copy `appliedRetention.txt` files inside `<-storageDataPath>/{data}` folders during [incremental backups](https://docs.victoriametrics.com/vmbackup.html#incremental-backups). Previously the new `appliedRetention.txt` could be skipped during incremental backups, which could lead to increased load on storage after restoring from backup. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5005).
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): suppress `context canceled` error messages in logs when `vmagent` is reloading service discovery config. This error could appear starting from [v1.93.5](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.93.5). See [this PR](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5048). * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): suppress `context canceled` error messages in logs when `vmagent` is reloading service discovery config. This error could appear starting from [v1.93.5](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.93.5). See [this PR](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5048).
* BUGFIX: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): allow passing [median_over_time](https://docs.victoriametrics.com/MetricsQL.html#median_over_time) to [aggr_over_time](https://docs.victoriametrics.com/MetricsQL.html#aggr_over_time). See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5034). * BUGFIX: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): allow passing [median_over_time](https://docs.victoriametrics.com/MetricsQL.html#median_over_time) to [aggr_over_time](https://docs.victoriametrics.com/MetricsQL.html#aggr_over_time). See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5034).