influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

Release 2.2 out-of-memory when using onKeep in filter on minimal query

Open MarcoPignati opened this issue 2 years ago • 1 comments

With Influx 2.2, the following minimal query generates 100% CPU and RAM leading to OOM. Same query is running fine if I downgrade to 2.1. Tried also with system with 64GB RAM.

Steps to reproduce: Run this query in 2.2 (it completely freezes my system, so you are warned)

import "experimental/array"

table=array.from(rows: [{_measurement: "m0", myvalue1: 0, myvalue2: 1, _time: 2020-01-01T00:00:00Z,},
                        {_measurement: "m0", myvalue1: 0, myvalue2: 1, _time: 2020-01-02T00:00:00Z}])

check = table
  |> filter(fn: (r) => r.myvalue1 >= r.myvalue2, onEmpty: "keep" ) 
  |> sort(columns: ["myvalue2"], desc: true)
  |> limit(n: 1)  
  |> yield(name:"check")

Expected behavior: Query generates no results

Actual behavior: Query generates 100% CPU and RAM leading to OOM. Query runs fine (no results) If I remove onEmpty:"keep" in the filter. Alternatively I can leave the filter unchanged and remove the |> limit(n: 1) to also avoid OOM (not what I want)

Same query (and all the other combinations) run fine if I downgrade to 2.1.

Environment info:

  • System info: Linux 5.4.0-109-generic x86_64
  • InfluxDB version: InfluxDB v2.2.0 (git: a2f8538837) build_date: 2022-04-06T17:36:40Z

Config:

bolt-path = "/var/lib/influxdb/influxd.bolt"
engine-path = "/var/lib/influxdb/engine"
http-bind-address = ":8086"
log-level = "error"
query-concurrency = 10
query-queue-size = 10
reporting-disabled = true
secret-store = "bolt"
session-length = 60
storage-retention-check-interval = "30m0s"
tls-cert = "/etc/ssl/influxdb-selfsigned.crt"
tls-key =  "/etc/ssl/influxdb-selfsigned.key"
tls-min-version = "1.1"
tls-strict-ciphers = true

Performance: Could not generate profiles during bug because system is unusable due to 100% CPU and RAM.

MarcoPignati avatar May 06 '22 07:05 MarcoPignati

same query on 2.3.0 works fine. So I will just update without knowing what was wrong in 2.2.0.

MarcoPignati avatar Jul 14 '22 08:07 MarcoPignati